[18575] in Perl-Users-Digest
Perl-Users Digest, Issue: 743 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 22 21:05:43 2001
Date: Sun, 22 Apr 2001 18:05:06 -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: <987987906-v10-i743@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 22 Apr 2001 Volume: 10 Number: 743
Today's topics:
Re: Another regexp question <bart.lateur@skynet.be>
Re: Another regexp question (Tad McClellan)
CGI.pm difference between 5.6.0 and 5.6.1 <tuc@ttsg.com>
CGI.pm difference between 5.6.0 and 5.6.1 <tuc@ttsg.com>
CGI.pm difference between 5.6.0 and 5.6.1 <tuc@ttsg.com>
Re: Daemon: should the parent exit or _exit after the f <Juha.Laiho@iki.fi>
Re: Getting character codes <flavell@mail.cern.ch>
Help with my feedback script <newuser@nospam.slip.net>
Re: Issue with 5.004 to 5.6 upgrade - Use strict now au (Abigail)
Re: Issue with 5.004 to 5.6 upgrade - Use strict now au <tuc@ttsg.com>
Re: Need help with Modul Mail::Send <boa@aaanet.ru>
Re: Need help with Modul Mail::Send (Abigail)
Re: pointer/reference question <xris@dont.send.spam>
Re: print<< <abe@ztreet.demon.nl>
Re: Problems with sending a sms <djsyntax@crazydj.de>
Re: Problems with sending a sms (Abigail)
Re: Problems with sending a sms (Tad McClellan)
Re: Programming perl modules <Juha.Laiho@iki.fi>
Re: Which is faster/better? <Juha.Laiho@iki.fi>
Re: Which is faster/better? <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 22 Apr 2001 22:06:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Another regexp question
Message-Id: <8fl6etk25ssmgm5mj4kilck41afe2f8ket@4ax.com>
Joe Schaefer wrote:
>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.
So a string in the middle may be empty, but one at the start or at the
end of the series may not? That's a goofy idea. Er... I mean,
inconsequent.
--
Bart.
------------------------------
Date: Sun, 22 Apr 2001 19:36:57 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Another regexp question
Message-Id: <slrn9e6qop.ipp.tadmc@tadmc26.august.net>
Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
>For a
>correct and elegent solution, see Tad's followup.
I should point out that my solution was lifted straight from
Stonehenge's Perl training materials (ie. I just repeated what
Randal had already said there).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 22 Apr 2001 19:02:45 -0400
From: Tuc <tuc@ttsg.com>
To: lstein@cshl.org
Subject: CGI.pm difference between 5.6.0 and 5.6.1
Message-Id: <3AE36315.8754902E@ttsg.com>
Hi,
Maybe its just me lately. Going past any of the 5.004 versions
hasn't worked for me. I tried 5.6.0, and I received all sorts of
warnings. When I went to 5.6.1, all the warnings leave, but the
following CGI snip acts
differently. The script is:
#!/usr/local/bin/perl
use CGI;
$tcgihandle = new CGI;
print "Done\n";
On 5.6.0, I get the proper response when running from the command line :
# ./t2.pl
(offline mode: enter name=value pairs on standard input)
tuc=test
Done
On 5.6.1, I don't get a proper response :
# ./t2.pl
Done
Because the script is running from the command line, it should consider
itself in "offline mode" and ask for me to enter information (Such as
tuc=test, then hit CTRL-D).
Whats happened?
Thanks, Tuc/TTSG Internet Services, Inc.
------------------------------
Date: Sun, 22 Apr 2001 19:03:11 -0400
From: Tuc <tuc@ttsg.com>
To: lstein@cshl.org
Subject: CGI.pm difference between 5.6.0 and 5.6.1
Message-Id: <3AE3632F.6130917C@ttsg.com>
Hi,
Maybe its just me lately. Going past any of the 5.004 versions
hasn't worked for me. I tried 5.6.0, and I received all sorts of
warnings. When I went to 5.6.1, all the warnings leave, but the
following CGI snip acts
differently. The script is:
#!/usr/local/bin/perl
use CGI;
$tcgihandle = new CGI;
print "Done\n";
On 5.6.0, I get the proper response when running from the command line :
# ./t2.pl
(offline mode: enter name=value pairs on standard input)
tuc=test
Done
On 5.6.1, I don't get a proper response :
# ./t2.pl
Done
Because the script is running from the command line, it should consider
itself in "offline mode" and ask for me to enter information (Such as
tuc=test, then hit CTRL-D).
Whats happened?
Thanks, Tuc/TTSG Internet Services, Inc.
------------------------------
Date: Sun, 22 Apr 2001 19:05:37 -0400
From: Tuc <tuc@ttsg.com>
To: lstein@cshl.org
Subject: CGI.pm difference between 5.6.0 and 5.6.1
Message-Id: <3AE363C1.183BD483@ttsg.com>
Hi,
Maybe its just me lately. Going past any of the 5.004 versions
hasn't worked for me. I tried 5.6.0, and I received all sorts of
warnings. When I went to 5.6.1, all the warnings leave, but the
following CGI snip acts
differently. The script is:
#!/usr/local/bin/perl
use CGI;
$tcgihandle = new CGI;
print "Done\n";
On 5.6.0, I get the proper response when running from the command line :
# ./t2.pl
(offline mode: enter name=value pairs on standard input)
tuc=test
Done
On 5.6.1, I don't get a proper response :
# ./t2.pl
Done
Because the script is running from the command line, it should consider
itself in "offline mode" and ask for me to enter information (Such as
tuc=test, then hit CTRL-D).
Whats happened?
Thanks, Tuc/TTSG Internet Services, Inc.
------------------------------
Date: 22 Apr 2001 10:20:57 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Daemon: should the parent exit or _exit after the fork?
Message-Id: <9buba9$2sa$3@ichaos.ichaos-int>
<garry@zvolve.com> said:
>On Thu, 19 Apr 2001 20:25:51 +0200, Philip Newton
><pne-news-20010419@newton.digitalspace.net> wrote:
>
>> I'm writing a daemon in Perl and am wondering whether I need to call exit or
>> _exit (well, POSIX::_exit) in the parent after the fork.
>
>By the way, perl calls _exit(2) when you call Perl's exit (on Solaris
>anyway):
>
> $ truss perl -eexit
> ...
...
> _exit(0)
> $
I think it isn't possible to (normally) finish a process so that _exit(2)
is not called: it gets called from exit(3) after other cleanup has been
done, and even if you write a C program where main() does not call exit(3)
but uses "return 0;", exit(3) (and thus _exit(2)) will be called. So at
least the use of _exit(2) is a very strong convention. I wonder if it
is possible to bypass _exit(2) even with assembly?
(note the technical detail; "program" can finish without calling
_exit(2) by calling execve(2), but the process remains the same
through the execve(2)).
But this is getting off-topic for clpm and on-topic for
comp.unix.programmer. Followups set to comp.unix.programmer.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ UH++++ UL++++$ P++@ L+++ E(-) W+$@ N++ !K w !O
!M V PS(+) PE Y+ PGP(+) t- 5 !X R tv--- b+ !DI D G e+ h--- r+++ y+++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: Mon, 23 Apr 2001 00:01:01 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Getting character codes
Message-Id: <Pine.LNX.4.30.0104222327360.29852-100000@lxplus003.cern.ch>
On Sat, 21 Apr 2001, echo 'Rudolf Polzer'>/dev/null wrote:
> A variant of this can be used to get ANSI
> codes of ASCII characters or the other way round,
If I thought there was any point in asking, I'd want to know what this
is supposed to mean.
Hint: ASCII defines a 7-bit code, with values therefore ranging from
0 to 127 decimal. Sometimes found with the high bit used as a parity
bit. The US-ASCII coding is _an_ ANSI standard, ANSI_X3.4-1986 (as
well as being an ISO standard, ISO646).
The term "ANSI coding" leads a strange twilight existence. According
to various documentation from Microsoft, the term "ANSI" is claimed to
denote a family of 8-bit codings defined by Microsoft. Strange, I
didn't know that the ANSI had been taken over by one vendor. In fact,
the ANSI seem to have gracefully retired from defining national
character codings, in favour of more international efforts in ISO.
US-ASCII is a subset (i.e positions 0 to 127) of _all_ of these
8-bit codings.
For Internet purposes, your authoritative reference is
http://www.isi.edu/in-notes/iana/assignments/character-sets
The only "ANSI" coding there, aside from the formal name of the
us-ascii coding, would seem to be ANSI_X3.110-1983, which doesn't seem
to be very widely used.
ttfn
------------------------------
Date: Sun, 22 Apr 2001 15:29:44 -0700
From: "newuser" <newuser@nospam.slip.net>
Subject: Help with my feedback script
Message-Id: <HUIE6.254$oV6.322@news1.dnvrcoidc.firstworld.net>
Hello,
I have received lots of great help in the past in this newsgroup and
would like if some can help me out with this problem that I am having.
Currently this script which I got help from is a feedback script where
people when visiting a webpage can make their comments. Right now it works
but when a person types their comments they go to the bottom of the list and
what I would like that they go on the top of list. See example
Existing
4/3/01 Very nice webpage
4/21/01 Webpage needs more work
What I would like
4/21/01 Webpage needs more work
4/3/01 Very nice webpage
#!/usr/bin/perl
require 'cgi-lib.pl';
&ReadParse(*in);
#for testing:
#$in{'name'} = "Joe";
#$in{'address'} = "joe\@bazooka.com";
#$in{'body'} = "Hi jim,\n\nHow the heck are you? :)\n\nSincerely, Joe";
print "Content-type: text/html\n\n";
print "<HTML><HEAD>\n";
print "<TITLE>Post Results</TITLE>\n";
print "</HEAD><BODY>\n";
$date=`date`;
chop($date); # trim \n
$file="feedback.html";
$tmp="/tmp/me-feedback.tmp";
#$tmp=~s/\//@/g; # make a unique tmp file name from the path
#$tmp="/tmp/$tmp";
if ( !$in{'comments'} || !$in{'performance'} || !$in{'username'} ||
!$in{realname)
{
&err("You haven't filled in all the the fields.\nBack up and try
again.");
}
$text=$in{'body'};
$text=~s/\r/ /g;
$text=~s/\n\n/<P>/g;
$text=~s/\n/ /g;
$text=~s/<P><P>/<P>/g;
#for testing:
#$date = "June 1996";
for($count=0;-f "$tmp"; $count++)
{
sleep(1);
&err("TMP file in use, giving up!") if ($count > 4);
}
open(TMP, ">$tmp") || &err("Can't open file.");
open(FILE, "<$file") || &err("Can't open file $file: $!");
while(<FILE>)
{
if (/<!--LASTDATE-->/)
{
print TMP "<!--LASTDATE--> $date \n";
} elsif (/<!--FEEDBACK-->/)
{
print TMP "<!--FEEDBACK-->\n";
$feedback++;
} elsif (/<!--POINTER-->/)
{
print TMP "<HR>";
print TMP "<B>$in{'name'} \n";
print TMP "<A HREF=\"mailto:$in{'address'}\">$in{'address'}</A>
</B>$date\n";
print TMP "<P>$text\n<!--POINTER-->\n";
} else
{
print TMP $_;
} # copy lines
}
if (! defined $feedback)
{
&err("not a Feedback file!");
}
open (TMP,"<$tmp")|| &err("Can't open tmp file.");
open (FILE,">$file")|| &err("Can't open file $file: $!");
print FILE <TMP>;
#while(<TMP>)
# {
# print FILE$_;
# }
close(FILE);
close(TMP);
unlink "$tmp";
print "<H1>Thank you!</H1>";
print "<P>Your comment has been added to the ";
print "<A HREF=\"feedback.html\">feedback</A>\n";
print "</BODY></HTML>\n";
sub err
{
local($msg)=@_;
print "$msg\n";
close FILE;
close TMP;
unlink "$tmp";
print "</BODY></HTML>\n";
exit;
}
------------------------------
Date: Sun, 22 Apr 2001 23:35:25 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <slrn9e6qlt.rfn.abigail@tsathoggua.rlyeh.net>
Tuc (tuc@ttsg.com) wrote on MMDCCXCI September MCMXCIII in
<URL:news: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.
A few points.
- Although some warnings are mandatory, the "used only once" isn't.
You probably managed to turn it on somehow.
- The perldelta and perl5005delta manpages will tell you what changed
between 5.004 and 5.6.
- There's no configuration option to enable/disable warnings.
Recompiling doesn't help.
- You probably want 5.6.1, not 5.6.0.
I hope you installed 5.6.0 on your test system, and not your production
system.
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: Sun, 22 Apr 2001 20:08:45 -0400
From: Tuc <tuc@ttsg.com>
To: abigail@foad.org
Subject: Re: Issue with 5.004 to 5.6 upgrade - Use strict now automatic?
Message-Id: <3AE3728D.3481AC3D@ttsg.com>
Abigail wrote:
>
> A few points.
>
> - Although some warnings are mandatory, the "used only once" isn't.
> You probably managed to turn it on somehow.
Yes, I've since found your right. It turns out it might be something with the
"Filter" package.
If I leave the program as plain source, it works fine. Once I "encrypt" it, it
begins to show issues.
The older system was 1.03, the newer one is 1.22 . I'm open to suggestions. I've
emailed Paul@BT to see if he might have an idea too.
> - The perldelta and perl5005delta manpages will tell you what changed
> between 5.004 and 5.6.
> - There's no configuration option to enable/disable warnings.
> Recompiling doesn't help.
Ok, thanks. I think the first isn't necessary now, the second was my ASSuM(E)ption
that something changed. Now it seems to be a Filter issue.
>
> - You probably want 5.6.1, not 5.6.0.
>
Well, I then set up another system with 5.6.1 and the new Filter. Doesn't give the
errors anymore. GREAT! Well, not really. Now my call to CGI.pm doesn't seem to
be working.... When I'd run something from command line, it'd go into "offline
mode". Now it just breezes past it. I tried to email Lincoln@CSHL but he did
something VERY BAD in his .forward it seems.
>
> I hope you installed 5.6.0 on your test system, and not your production
> system.
It isn't test, but it is a replacement for a production. (Enterprise 450 replacing
an Ultra 1)
Thanks, Tuc/TTSG Internet Services, Inc.
------------------------------
Date: Sun, 22 Apr 2001 19:41:08 +0400
From: "Oleg Bakiev" <boa@aaanet.ru>
Subject: Re: Need help with Modul Mail::Send
Message-Id: <9buuaq$257m$1@sa.aaanet.ru>
"Bastian Ballmann" <djsyntax@crazydj.de> сообщил/сообщила в новостях
следующее: news: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
>
Could you show the piece of your script that doesn't work?
------------------------------
Date: Mon, 23 Apr 2001 00:32:46 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Need help with Modul Mail::Send
Message-Id: <slrn9e6u1e.rfn.abigail@tsathoggua.rlyeh.net>
Bastian Ballmann (djsyntax@crazydj.de) wrote on MMDCCXCI September
MCMXCIII in <URL:news:20010422.223337.1504569917.1210@Syntaxerror.crazydj.de>:
{}
{} Thanx but I have helped myself :-)
Don't you know that will make you blind?
Abigail
--
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:
------------------------------
Date: Sun, 22 Apr 2001 18:00:56 -0500
From: xris <xris@dont.send.spam>
Subject: Re: pointer/reference question
Message-Id: <xris-EAD305.18005622042001@news.evergo.net>
I guess as I think more about this, my main question is whether or not
you can do something to the extent of:
$x = $$x;
but NOT copy the value, which I'm pretty sure this does (takes a copy of
the value at $$x and stores it in $x, as opposed to assigning $x the
same memory location as the data in $$x).
------------------------------
Date: Mon, 23 Apr 2001 01:15:56 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: print<<
Message-Id: <d9p6etgq7l4n696t6bm8qiqsrf4r2257n9@4ax.com>
On Sun, 22 Apr 2001 21:10:03 +0100, "John Plaxton"
<19wlr@globalnet.co.uk> wrote:
> 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.
Did you check the three items in the FAQ answer?
perldoc -q 'here doc'
Found in perlfaq4.pod: "Why don't my <<HERE documents work?"
--
Good luck, Abe
Amsterdam Perl Mongers http://amsterdam.pm.org
perl -wle '$_=q@Just\@another\@Perl\@hacker@;print qq@\@{[split/\@/]}@'
------------------------------
Date: Mon, 23 Apr 2001 00:33:05 +0200
From: "Bastian Ballmann" <djsyntax@crazydj.de>
Subject: Re: Problems with sending a sms
Message-Id: <20010423.003305.2130794395.10477@Syntaxerror.crazydj.de>
Im Artikel <20010422.232704.774044599.1210@Syntaxerror.crazydj.de> schrieb
"Bastian Ballmann" <djsyntax@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
The only thing I have to say to my posting is now: Just forget it!
It was a fault!
Sorry...
...but even now --> still happy perling out there
We'll see tommorrow with a better mind...
Greetz
Bastian Ballmann
------------------------------
Date: Sun, 22 Apr 2001 23:08:54 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Problems with sending a sms
Message-Id: <slrn9e6p46.rfn.abigail@tsathoggua.rlyeh.net>
Bastian Ballmann (djsyntax@crazydj.de) wrote on MMDCCXCI September
MCMXCIII in <URL:news:20010422.232704.774044599.1210@Syntaxerror.crazydj.de>:
-: Hi @all!!!
-: Has anyone of ya another idea how to send a sms without a SMS module?
Yes. I had an answer typed here, but then I read your reason.
-: 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!!!
Why don't you fuck off yourself?
Abigail
--
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
------------------------------
Date: Sun, 22 Apr 2001 19:43:04 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Problems with sending a sms
Message-Id: <slrn9e6r48.ipp.tadmc@tadmc26.august.net>
Bastian Ballmann <djsyntax@crazydj.de> wrote:
>Im Artikel <20010422.232704.774044599.1210@Syntaxerror.crazydj.de> schrieb
>"Bastian Ballmann" <djsyntax@crazydj.de>:
>
>> to fu**
>> off my ex girlfriend!!!
>The only thing I have to say to my posting is now: Just forget it!
Too late. You've already been killfiled.
>Sorry...
Names go into the killfile, but they don't come out.
Sorry...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 22 Apr 2001 10:01:32 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Programming perl modules
Message-Id: <9bua5s$2sa$2@ichaos.ichaos-int>
"Bastian Ballmann" <djsyntax@crazydj.de> said:
>Im Artikel <nrrE6.60$UA4.208711680@news.frii.net> schrieb "Chris Fedde"
><cfedde@fedde.littleton.co.us>:
>> The absolute simplest thing that might be called a module would be a
>> file that contains something like the following:
>>
>> package PackageName;
>>
>> 1;
>I try to do the following:
>
>package testmodul;
>
>sub new
>{
>print "Test\n";
>return1;
>}
...
>Than I get the error: testmodul do not return a true value.
>But I am returning a true value of 1...
From the function within the module, yes (I assume in your real code
you do have a space between the "return" and "1"), but not from your
module itself. Compared with the extremely minimal test that Chris
gave you, you should add a line containing just "1;" (omitting the
quotes) on the last line of your module, outside any function contained
within the module. See also the FAQ entry "How do I create a module".
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ UH++++ UL++++$ P++@ L+++ E(-) W+$@ N++ !K w !O
!M V PS(+) PE Y+ PGP(+) t- 5 !X R tv--- b+ !DI D G e+ h--- r+++ y+++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: 22 Apr 2001 09:49:13 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Which is faster/better?
Message-Id: <9bu9ep$2sa$1@ichaos.ichaos-int>
xris <xris@dont.send.spam> said:
>The perl book talks about using join() instead of a sequence of
>concatenated strings, but doesn't really say much more than that, so my
>question is, which is faster?
...
>I've been programming in perl for over 6 years now,
Then it's high time to learn the 'Benchmark' module. "perldoc Benchmark".
Also, check whether you really need to concatenate the strings -- or do
you just need to output them:
I'd claim the following doesn't concatenate the variables before output,
but just prints the values:
print $foo,$bar,"constant data",$baz,"\n";
(and if I'm mistaken in this, please do correct me..)
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ UH++++ UL++++$ P++@ L+++ E(-) W+$@ N++ !K w !O
!M V PS(+) PE Y+ PGP(+) t- 5 !X R tv--- b+ !DI D G e+ h--- r+++ y+++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: Sun, 22 Apr 2001 22:46:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Which is faster/better?
Message-Id: <grn6etoaakmj5ec4pnf10kfeu8uf0fj3vm@4ax.com>
Me wrote:
>>I've been programming in perl for over 6 years now, and tend to use
>>whatever looks cleanest, but being an efficiency nut, I'd really
>>like to know the differences between all of these ways of doing
>>things.
>
>So in those 6 years, did you ever hear of the Benchmark module?
Benchmark can tell you which is faster. What it doesn't tell you, or
compare, is memory usage.
--
Bart.
------------------------------
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 743
**************************************