[23162] in Perl-Users-Digest
Perl-Users Digest, Issue: 5383 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 18 03:05:51 2003
Date: Mon, 18 Aug 2003 00: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)
Perl-Users Digest Mon, 18 Aug 2003 Volume: 10 Number: 5383
Today's topics:
can I still post here? <scripts_you_know_the_drill_@hudsonscripting.com>
Re: can I still post here? <abuseonly@sgrail.org>
Re: can I still post here? <scripts_you_know_the_drill_@hudsonscripting.com>
Re: can I still post here? <kasp@epatra.com>
Re: CGI is not so hard <wsegrave@mindspring.com>
Re: comp.lang.perl.open.discussion rfc in alt.config <scripts_you_know_the_drill_@hudsonscripting.com>
Re: comp.lang.perl.open.discussion rfc in alt.config <scripts_you_know_the_drill_@hudsonscripting.com>
flock() on different Unix platform <sun@cnnic.cn>
Re: flock() on different Unix platform (David Efflandt)
Re: hash key of %ENV is case insensitive (Win32) (John Lin)
Re: how to rename 200 files in many sub-directories? <bart.lateur@pandora.be>
Re: how to rename 200 files in many sub-directories? <bart.lateur@pandora.be>
Re: how to rename 200 files in many sub-directories? <geoff.cox@blueyonder.co.uk>
Re: Hudson River <tim@vegeta.ath.cx>
Re: Hudson River <noreply@gunnar.cc>
Re: Hudson River (ko)
Re: Hudson River <tim@vegeta.ath.cx>
Re: Multithreading and sockets blocking I/O on Win32 <ndronen@io.frii.com>
Re: Order of evaluation of expressions <REMOVEsdnCAPS@comcast.net>
perl 5.8.0 failed some locale tests on redhat 9 (trwww)
Re: Perl and recursive copying? (James Willmore)
Re: simple perl script <chesucat@freeshell.org>
Re: simple perl script (Sam Holden)
Re: simple perl script <chesucat@freeshell.org>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Aug 2003 01:43:44 -0700
From: hudson <scripts_you_know_the_drill_@hudsonscripting.com>
Subject: can I still post here?
Message-Id: <7a41kvgda768tth6s6tpph7rmcg8bhccmd@4ax.com>
I like this newsgroup, even though I have heard lots of people have me
on kill file now.
Is it OK if I still post here?
------------------------------
Date: Mon, 18 Aug 2003 05:44:36 GMT
From: derek / nul <abuseonly@sgrail.org>
Subject: Re: can I still post here?
Message-Id: <ptp0kvgo3knv8085kg5vl5f8kasoc6ahto@4ax.com>
On Mon, 18 Aug 2003 01:43:44 -0700, hudson
<scripts_you_know_the_drill_@hudsonscripting.com> wrote:
>I like this newsgroup, even though I have heard lots of people have me
>on kill file now.
>
>Is it OK if I still post here?
if you have a perl question
------------------------------
Date: Mon, 18 Aug 2003 01:52:07 -0700
From: hudson <scripts_you_know_the_drill_@hudsonscripting.com>
Subject: Re: can I still post here?
Message-Id: <ds41kvks52vqk6u3dbrl4f828taqtg67ng@4ax.com>
>>Is it OK if I still post here?
>
>if you have a perl question
OK...thank you
------------------------------
Date: Mon, 18 Aug 2003 12:02:11 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Re: can I still post here?
Message-Id: <bhps6c$csd$1@newsreader.mailgate.org>
> Is it OK if I still post here?
Hudson, no one stops you from posting. Post (as Derek pointed out) if you
have a Perl question/
People will appreciate you and your Perl skills more if your posts are terse
and high in information.
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.
------------------------------
Date: Sun, 17 Aug 2003 22:42:58 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: CGI is not so hard
Message-Id: <bhpi63$v0d$1@slb4.atl.mindspring.net>
"hudson" <scripts_you_know_the_drill_@hudsonscripting.com> wrote in message
news:tuotjv0dtc59r9jqvo4rklv2jcvu1dd59p@4ax.com...
> >Hmm. Are you not aware that '&' (as a separator) is deprecated?
>
> this is just code for fun and is working fine for me...but I guess
> code for production has to have higher standards
>
Indeed it does. If you never deploy your code to a place where nefarious
attacks can exploit possible security holes, I suppose you can do as you
wish. OTOH, if you place resources that are shared by all at risk, you are
held to a higher standard.
> >This is just one of the reasons why rolling your own parser is not a good
> >idea. You might search for
> >
> > sub parse_params {
> >
> >in a recent (non-broken) copy of CGI.pm to see how it's done.
>
> thanks, that is an interesting tip
>
> >FWIW, I shudder to think of what your next few lines of code would have
> >been.
>
> maybe something like:
>
> $my_system_vanishes = `$kv{untainted_value}`;
Well, that's not what I had in mind. I should have been explicit; but I had
not found the quotation from another thread (Re: hand crafting ...), i.e.,
> read (STDIN, my $input, $ENV{'CONTENT_LENGTH'});
> my @kv = split (/&/, $input);
Here's where you might have done better with
my @kv = split (/[&;]/, $input);
> for my $kv (@kv) {
> (my $key, my $value) = split (/=/, $kv);
<snip>
> $value =~ tr/+/ /;
> $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
>
You may have noted that in the parse_params subroutine of CGI.pm, that both
the params and values are unescaped, whereas you have only processed the
values.
Failing to deal with $key in similar fashion (to what is done for $value) is
a common mistake committed
by beginners, e.g., your parsing scheme wouldn't work well with any instance
of the submittal of
'a key like this';
because it would leave it in the form
'a+key+like+this'
I'll leave it to you to conjure up other possibilities where this will,
well, cause you some inconvenience.
Cheers.
Bill Segraves
------------------------------
Date: Sun, 17 Aug 2003 22:07:38 -0700
From: hudson <scripts_you_know_the_drill_@hudsonscripting.com>
Subject: Re: comp.lang.perl.open.discussion rfc in alt.config
Message-Id: <ann0kvglhl41q6go88dl449da8v7453taf@4ax.com>
On Mon, 18 Aug 2003 00:28:21 GMT, "David Formosa (aka ? the Platypus)"
<dformosa@dformosa.zeta.org.au> wrote:
>> comp.lang.perl.misc.according-to-hudson
>
>Comes off a misc.
hehe...can we do this??
aw hell...I don't have the energy to answer all the questions, though
;-)
------------------------------
Date: Sun, 17 Aug 2003 22:12:20 -0700
From: hudson <scripts_you_know_the_drill_@hudsonscripting.com>
Subject: Re: comp.lang.perl.open.discussion rfc in alt.config
Message-Id: <etn0kvkeqls7penebp2l59lkl1ekb67bq6@4ax.com>
On Sun, 17 Aug 2003 19:08:35 GMT, Rocco Caputo <dngor@bellsouth.net>
wrote:
>You seem to have entered into a bad situation here. Rather than trying
>to extricate yourself from it and make amends with the Perl community at
>large, you seem to just be digging yourself deeper into it.
I am open to making amends...in fact, I emailed uri last night. It is
just 30 against 1 is bad odds for me and as soon as I try to settle
down, someone posts some inane thing to piss me off again.
------------------------------
Date: Mon, 18 Aug 2003 11:43:16 +0800
From: Sun Guonian <sun@cnnic.cn>
Subject: flock() on different Unix platform
Message-Id: <3F404B54.FCD67503@cnnic.cn>
Hi,
I want to Perl flock() between to process to work with one output
data file.
But on different Unix platform, I got different results.
As followed, on Solaris7, It could work. (compile the perl-5.8.0
with default options)
But on Redhat Linux(7.3/8.0/9.0 for Intel), it couldn't work.
the output file is messed, mixed with ('A','B','C','D')
and ('1','2','3','4')
(compile the perl-5.8.0 with default options)
Someone had told me that it is related to the compile
option of Perl, and I haved tried "-Ud_flock", but it still
don't work.
I wonder if my script have any problem or anything else is
wrong.
Any advices is appreciated!
Best Regards,
Sun Guonian
===== On Solaris 7 for SPARC platform =====
% cat lock03.pl
#!/usr/bin/perl
use Fcntl ':flock';
use strict;
my($res);
my($pid);
open(FH, ">lock_out");
if($pid=fork()) {
sleep(1);
$res=mylock();
print "$$: lock res=$res\n";
sleep(5);
writefile('A' x 40);
sleep(5);
writefile('B' x 40);
sleep(5);
writefile('C' x 40);
sleep(5);
writefile('D' x 40);
$res=myunlock();
print "$$: unlock res=$res\n";
}
elsif($pid==0) {
$res=mylock();
print "$$: lock res=$res\n";
sleep(3);
writefile('1' x 40);
sleep(3);
writefile('2' x 40);
sleep(3);
writefile('3' x 40);
sleep(3);
writefile('4' x 40);
$res=myunlock();
print "$$: unlock res=$res\n";
exit(0);
}
sub writefile {
my($var)=@_;
my($max)=80000;
my($i);
for($i=0;$i<$max;$i++) {
print FH "$var\n";
}
}
sub mylock {
flock(FH, LOCK_EX);
seek(FH, 0, 2);
return 1;
}
sub myunlock {
flock(FH, LOCK_UN);
}
% ./lock03.pl
16198: lock res=1
16198: unlock res=1
16197: lock res=1
16197: unlock res=1
% wc lock_out
640000 640000 26240000 lock_out
% uniq lock_out > kkk
% cat kkk
1111111111111111111111111111111111111111
2222222222222222222222222222222222222222
3333333333333333333333333333333333333333
4444444444444444444444444444444444444444
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
===== On Solaris 7 for SPARC platform =====
------------------------------
Date: Mon, 18 Aug 2003 05:27:42 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: flock() on different Unix platform
Message-Id: <slrnbk0oue.oos.efflandt@typhoon.xnet.com>
On Mon, 18 Aug 2003 11:43:16 +0800, Sun Guonian <sun@cnnic.cn> wrote:
> Hi,
> I want to Perl flock() between to process to work with one output
> data file.
> But on different Unix platform, I got different results.
> As followed, on Solaris7, It could work. (compile the perl-5.8.0
> with default options)
>
> But on Redhat Linux(7.3/8.0/9.0 for Intel), it couldn't work.
> the output file is messed, mixed with ('A','B','C','D')
> and ('1','2','3','4')
> (compile the perl-5.8.0 with default options)
>
> Someone had told me that it is related to the compile
> option of Perl, and I haved tried "-Ud_flock", but it still
> don't work.
>
> I wonder if my script have any problem or anything else is
> wrong.
I tested it on my Solaris ISP and it was similar to your Solaris.
Perhaps this gives a clue why Linux worked different (perldoc -f flock):
On systems that support a real flock(), locks are
inherited across fork() calls, whereas those that
must resort to the more capricious fcntl() func
tion lose the locks, making it harder to write
servers.
Since you opened the file before forking, the FH was not unique and
therefore did not prevent parent and child writing to it at same time.
When I moved the open down after the fork so each FH was really different:
if($pid=fork()) {
open(FH, ">lock_out");
and
elsif($pid==0) {
open(FH, ">lock_out");
It still produced:
9952: lock res=1
9951: lock res=1
9952: unlock res=1
9951: unlock res=1
However, uniq lock_out > kkk; cat kkk produced:
1111111111111111111111111111111111111111
2222222222222222222222222222222222222222
3333333333333333333333333333333333333333
4444444444444444444444444444444444444444
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: 17 Aug 2003 20:02:19 -0700
From: johnlin@chttl.com.tw (John Lin)
Subject: Re: hash key of %ENV is case insensitive (Win32)
Message-Id: <a73bcad1.0308171902.61d04818@posting.google.com>
Thank you. You are very nice. : )
------------------------------
Date: Sun, 17 Aug 2003 17:53:08 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <bvfvjvsqq59aae8lohu9e3r6mknvc1m4rh@4ax.com>
Geoff Cox wrote:
>I would like to run wzunzip.exe (command line version of WinZip) to
>expand each zip file, rename the doc file to name of its zip file and
>then delete the zip file....
With Perl? Nah.... you'd better use Archive::Zip. From the docs:
extractMember( $memberOrName [, $extractedName ] )
The second optional argument is the name to save the extracted file
under.
You can get a list of existing members (the files in the archive) with
the "members" method.
So what you need to do is make a copy of the filename of the zipfile,
and replace the extension with ".doc".
($docname = $zipname) =~ s/\.zip$/.doc/i;
--
Bart.
------------------------------
Date: Mon, 18 Aug 2003 03:29:58 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <mmh0kvc421vll9skut5dvm59dd9q3fadug@4ax.com>
Geoff Cox wrote:
>Thanks for info - can I use this with Perl under Windows 98 (SE) ?
Yuppers.
If you don't have it, you can get it from
<http://ppm.activestate.com/PPMPackages/zips/> (choose your proper
subdirectory). Fetch and uncompress Archive::Zip and Compress::Zlib (at
least you probably will have the latter, as PPM uses it to decompress
.gz files), and use PPM to install it/them.
--
Bart.
------------------------------
Date: Mon, 18 Aug 2003 08:03:54 +0100
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <fcu0kvg36621f4hb9q6odp2sfe207i58ka@4ax.com>
On Sun, 17 Aug 2003 17:53:08 GMT, Bart Lateur <bart.lateur@pandora.be>
wrote:
>With Perl? Nah.... you'd better use Archive::Zip. From the docs:
Bart,
Getting close now! I have not yet understood to to use Archive::Zip
code though - could you give me a few lines of code to show how you
get the names of the zip files, extract the doc file within the zip
file and then rename it?! I know this is asking a lot but am stuck at
the moment and cannot find any basic tutorial stuff for this!
Cheers
Geoff
>
> extractMember( $memberOrName [, $extractedName ] )
>
>The second optional argument is the name to save the extracted file
>under.
>
>You can get a list of existing members (the files in the archive) with
>the "members" method.
>
>So what you need to do is make a copy of the filename of the zipfile,
>and replace the extension with ".doc".
>
> ($docname = $zipname) =~ s/\.zip$/.doc/i;
------------------------------
Date: 17 Aug 2003 18:29:26 -0700
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Hudson River
Message-Id: <slrnbk0b1q.cpl.tim@vegeta.ath.cx>
Gunnar Hjalmarsson graced us by uttering:
> Tim Hammerquist wrote:
>> Let me summarize this thread for anyone who might be joining us
>> late.
>>
>> OP == Original Poster.
>> EE == Everyone Else
>>
[ snipped summary ]
>
> Even if I disapprove of the accuracy of your summary, I hope
> you had fun when you wrote it.
The OP in this case is a composite of you, hudson, and the dozens
of other plaintiffs I've seen make the same arguments in the last
5 years. So I realize you aren't personally responsible for all
the above statements, but did I leave anything out? Any other
arguments you plan to bring to the table I might include?
And I did get notable enjoyment out of this, thanks.
Tim Hammerquist
--
When angry, count four; when very angry, swear.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"
------------------------------
Date: Mon, 18 Aug 2003 05:04:51 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Hudson River
Message-Id: <bhpfpa$1pduu$1@ID-184292.news.uni-berlin.de>
Tim Hammerquist wrote:
> The OP in this case is a composite of you, hudson, and the dozens
> of other plaintiffs I've seen make the same arguments in the last 5
> years.
Is he? In that case, the 'summary' was falsely introduced, so you'd
better post a corrective message as a direct reply to your own message
which includes the summary.
> So I realize you aren't personally responsible for all the above
> statements, but did I leave anything out?
You did *not* include *any* of the points I have been trying to make
in this thread, so I find it hard to believe that you aren't just
stating your own opinion in a bantering way.
> Any other arguments you plan to bring to the table I might include?
No, my arguments don't fit in your table.
This is *my* summary of what I have been trying to say:
I'm an adult. I make my own decisions. Of course I listen to advise
from people who are more knowledgable and/or experienced than I am,
but in the end I rely on my own judge and make my own decisions. This
is the case also when I'm writing a Perl program and decide whether
it's appropriate to use a module for solving a particular task.
Quite a few of the 'regulars' in clpmisc occationally act as if the
typical reader is a kid. They keep repeating very dogmatic programming
rules, and meet everyone who don't completely 'obey' in a patronizing
way. That's bad. As an adult I find it insulting from time to time.
I do appreciate all the knowledge and advise that the regulars
generously deliver here, but I don't appreciate the 'tone' that is
occasionally used when doing so.
I believe that clpmisc would be an even better group, if some advises
were delivered in a more respectful way, taking into consideration
that the typical reader is an adult with the ability to consider a
good advise and make a decision based on their own judgement.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 17 Aug 2003 21:27:03 -0700
From: kuujinbo@hotmail.com (ko)
Subject: Re: Hudson River
Message-Id: <92d64088.0308172027.66366eeb@posting.google.com>
> Hrrmm... With all respect, Keith, could you please clarify who you are
> referring to with the expression "this guy"? My name is Gunnar, I
> started this thread, and I'm not the same person as is mentioned in
> the subject line of this thread.
Sorry Gunnar, I was referring to the subject of the thread, the
recently 'popular' Hudson.
keith
------------------------------
Date: 17 Aug 2003 21:36:59 -0700
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Hudson River
Message-Id: <slrnbk0m1d.dgr.tim@vegeta.ath.cx>
Gunnar Hjalmarsson graced us by uttering:
> Tim Hammerquist wrote:
>> The OP in this case is a composite of you, hudson, and the
>> dozens of other plaintiffs I've seen make the same arguments
>> in the last 5 years.
>
> Is he? In that case, the 'summary' was falsely introduced, so
> you'd better post a corrective message as a direct reply to
> your own message which includes the summary.
No. I said "OP == Original Poster", which is true. The
composite is based on the original poster of all such articles,
including the OP of this thread.
> This is *my* summary of what I have been trying to say:
>
> I'm an adult.
To the group: Did anyone here challenge Gunnar's adulthood?
> Of course I listen to advise from people who are more
> knowledgable and/or experienced than I am, but in the end I
> rely on my own judge and make my own decisions.
Good. So why are you still arguing in usenet?
> Quite a few of the 'regulars' in clpmisc occationally act as if
> the typical reader is a kid. They keep repeating very dogmatic
> programming rules, and meet everyone who don't completely
> 'obey' in a patronizing way. That's bad. As an adult I find it
> insulting from time to time.
I find the willingness of the group to keep repeating things the
readers don't seem to grasp is a sign of patience. YMMV.
> I do appreciate all the knowledge and advise that the regulars
> generously deliver here, but I don't appreciate the 'tone' that
> is occasionally used when doing so.
comp.lang.python may be the answer here. See my post in another
thread where I say as much.
> I believe that clpmisc would be an even better group, if some
> advises were delivered in a more respectful way, taking into
> consideration that the typical reader is an adult with the
> ability to consider a good advise and make a decision based on
> their own judgement.
Bernard El-Hagin has come to the same conclusion and has posted
an aid to help you... 2 years ago. I won't waste your time
mentioning how this confirms how original your claims aren't.
(Oops. I just did.) But it just might help you:
http://groups.google.com/groups?th=a378813d05423a80
HTH. HAND.
Tim Hammerquist
--
It's astonishing how much trouble one can
get oneself into, if one works at it.
-- Destruction, The Sandman
------------------------------
Date: 18 Aug 2003 02:22:31 GMT
From: Nicholas Dronen <ndronen@io.frii.com>
Subject: Re: Multithreading and sockets blocking I/O on Win32
Message-Id: <3f403867$0$200$75868355@news.frii.net>
Dragos D <ddragos@iname.com> wrote:
DD> Hello!
DD> I'm posting here as a last, desperate attempt to solve a problems that made
DD> me pull my hair off: I want to create (as a cradle for further development)
DD> a simple, basic, transparent proxy server for any protocol, using threads
DD> (the new model, "use threads" instead of "use Thread"). That is, only one
DD> client will connect to the server, the server will connect in turn to a
DD> remote server, then it will relay data from the remote server to the client,
DD> and from the client to the remote server.
DD> This has to run on Windows, so I'm using ActiveState Perl 5.0.8 build 805
DD> running under Windows 98 SE.
DD> After accepting a connection, the program launches one thread to read data
DD> from the client and send it to the server, and another thread to read data
DD> from the remote server and send it to the client. The idea is NOT to
DD> interpret data in any way, just relay it until the client and the server
DD> close the connection.
DD> I chose as an example connecting to a POP3 server, pop.lycos.co.uk. OK, so I
DD> run it, then fire up a telnet client and connect to localhost:8080. The
DD> telnet client correctly sees the POP3 server's greeting message (+OK...),
DD> then I type "hi" (an invalid command, which should produce a "-ERR" response)
DD> but... the "hi" is NOT sent (packet sniffer reveals no traffic after the
DD> +OK response). Accordingly, the last line I see on STDERR is:
DD> TO remote: [hi] at ...
DD> Suggesting that the "print {$remoteServer} $lineout, $EOL;" hangs the script.
DD> Can someone please confirm this behaviour on Windows or infirm it on *nix?
It works on Linux.
$ ./foo
FROM remote TO client: [+OK POP3 server ready <27091.1061173257@lycos-europe.com>] at ./foo line 39, <GEN2> line 1.
After print to client at ./foo line 41, <GEN2> line 1.
TO remote: [hi] at ./foo line 27, <GEN1> line 1.
After print TO remoteServer at ./foo line 30, <GEN1> line 1.
FROM remote TO client: [-ERR Unknown command.] at ./foo line 39, <GEN2> line 2.
After print to client at ./foo line 41, <GEN2> line 2.
$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK POP3 server ready <27091.1061173257@lycos-europe.com>
hi
-ERR Unknown command.
Connection closed by foreign host.
Regards,
Nicholas
--
"Why shouldn't I top-post?" http://www.aglami.com/tpfaq.html
"Meanings are another story." http://www.ifas.org/wa/glossolalia.html
------------------------------
Date: Sun, 17 Aug 2003 20:05:44 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Order of evaluation of expressions
Message-Id: <Xns93DAD6841E7E9sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
mjd@plover.com (Mark Jason Dominus) wrote in news:bhok6j$70f$1@plover.com:
> Is this:
>
> @s = qw(a b);
> $z = shift(@s) . shift(@s);
> print $z;
>
> guaranteed to print "ab"?
>
Yes. Unlike C, Perl's order-of-evaluation is well-defined.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP0AmSWPeouIeTNHoEQKBeQCg+Q49AV+cfvYwnHNTFxenN5ktYOAAnjv+
aJGfREuPkOdtbWxNasYNnWz6
=oCju
-----END PGP SIGNATURE-----
------------------------------
Date: 17 Aug 2003 21:18:40 -0700
From: toddrw69@excite.com (trwww)
Subject: perl 5.8.0 failed some locale tests on redhat 9
Message-Id: <d81ecffa.0308172018.2582a801@posting.google.com>
I have some failed tests when running 'make test' for perl 5.8.0 on
redhat 9. Below are the failed tests and messages, and below that is
the output of ./myconfig per
http://www.perldoc.com/perl5.8.0/INSTALL.html#Reporting-Problems
Todd W.
...
lib/locale...........................Malformed UTF-8 character
(unexpected non-continuation byte 0x61, immediately after start byte
0xe7) in pattern match (m//) at ../lib/locale.t line 526.
ok
lib/Locale/Codes/t/all...............Malformed UTF-8 character
(unexpected end of string) at ../lib/Locale/Language.pm line 115,
<DATA> line 109.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 117, <DATA> line 109.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 115, <DATA> line 178.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 117, <DATA> line 178.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 66.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 66.
FAILED at test 9
lib/Locale/Codes/t/constants.........ok
lib/Locale/Codes/t/country...........ok
lib/Locale/Codes/t/currency..........ok
lib/Locale/Codes/t/languages.........Malformed UTF-8 character
(unexpected end of string) at ../lib/Locale/Language.pm line 115,
<DATA> line 109.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 117, <DATA> line 109.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 115, <DATA> line 178.
Malformed UTF-8 character (unexpected end of string) at
../lib/Locale/Language.pm line 117, <DATA> line 178.
FAILED at test 22
...
[root@waveright perl-5.8.0]# ./myconfig
Summary of my perl5 (revision 5.0 version 8 subversion 0)
configuration:
Platform:
osname=linux, osvers=2.4.20-8, archname=i686-linux
uname='linux waveright.homeip.net 2.4.20-8 #1 thu mar 13 17:54:28
est 2003 i686 i686 i386 gnulinux '
config_args='-Dinstallprefix=/usr/local/perl -Uinstallusrbinperl
-Dman3dir=/usr/local/perl/lib/man/man3'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O3',
cppflags='-fno-strict-aliasing -I/usr/include/gdbm'
ccversion='', gccversion='3.2.2 20030222 (Red Hat Linux 3.2.2-5)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.3.2.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
------------------------------
Date: 17 Aug 2003 23:15:32 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: Perl and recursive copying?
Message-Id: <e0160815.0308172215.1a79f2ef@posting.google.com>
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message news:<ypU%a.11$Yx6.2912@news.dircon.co.uk>...
> Conceptually, perhaps, yes. But the term _lexical_ itself occludes
> the simplicity of the idea. The term _package_ finds expression in the
> perl syntax and is similar in its use there as it is in human languages,
> whereas the _lexical_ is an uncommon word and it appears to be used in an
> essentially metaphorical manner in describing the scope of stuff in Perl.
> The perlfaq item:
>
> How can I access a dynamic variable while a
> similarly named lexical is in scope?
>
> seems to make a further leap by assuming the reader will fill in the
> 'ly scoped variable' (yes, the patch is in the post :-)
>
> So on balance I'm not surprised that people find lexically scoped thingies
> ( and how much more difficult it is on the brain when these things aren't
> simple identifiers like variables) more difficult to understand than
> package scoped ones.
>
> Now what was my point again?
LOL. I'm not sure if I should say this, but I felt, for just a
moment, that I was part of "The Hitchhicker's Guide to the Galaxy"
(the TV version, not the book or radio - which I have yet to hear).
I'm hoping that you were trying to be a little humorous in your post.
If not, my appologies in advance.
Jim
------------------------------
Date: Sun, 17 Aug 2003 21:58:54 -0400
From: Chesucat <chesucat@freeshell.org>
Subject: Re: simple perl script
Message-Id: <Pine.NEB.4.33.0308172151190.8775-100000@vinland.freeshell.org>
On Sun, 17 Aug 2003, Jerry Maguire wrote:
> Hi,
> I would like to write a perl script to open and file and add a prefix to all
> the lines of that file.
> The file will be like:
>
> name1blah
> name2blah
> name3blah
>
> I have created the following script:
> #!/bin/sh
> cat test |
> while read name
> do
> printf 'new'$name>>newfile.txt;
> done
<snipped>
'ello,
I hope this is what you wanted. This shell script understand that there
is no newline after nameblah3, otherwise it will add a 'new' to the
newline.
I have revised your original script:
#!/bin/sh
cat test |
while read name
do
echo 'new'$name\n>>newfile.txt;
done
In the future, you might want to post in comp.unix.shell!;-)
chesucat
--
chesucat@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
What George Washington did for us was to throw out the British, so
that we wouldn't have a fat, insensitive government running our
country. Nice try anyway, George.
-- D.J. on KSFO/KYA
------------------------------
Date: 18 Aug 2003 02:02:52 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: simple perl script
Message-Id: <slrnbk0cuc.tnh.sholden@flexal.cs.usyd.edu.au>
On Sun, 17 Aug 2003 21:58:54 -0400, Chesucat <chesucat@freeshell.org> wrote:
>
> I have revised your original script:
> #!/bin/sh
> cat test |
> while read name
> do
> echo 'new'$name\n>>newfile.txt;
> done
Except of course that echo adds a newline by default. And echo \n will
output "n"... - since \n will be converted to n by most shells, if you
have a strange shell that doesnt do that then it'll output "\n"
> In the future, you might want to post in comp.unix.shell!;-)
A good idea.
--
Sam Holden
------------------------------
Date: Sun, 17 Aug 2003 22:33:02 -0400
From: Chesucat <chesucat@freeshell.org>
Subject: Re: simple perl script
Message-Id: <Pine.NEB.4.33.0308172225420.8775-100000@vinland.freeshell.org>
On 18 Aug 2003, Sam Holden wrote:
> Except of course that echo adds a newline by default. And echo \n will
> output "n"... - since \n will be converted to n by most shells, if you
> have a strange shell that doesnt do that then it'll output "\n"
>
> > In the future, you might want to post in comp.unix.shell!;-)
>
> A good idea.
Yeah, I forgot about! But, anyway, it worked ksh! I figured he might
have to tweak it some for his shell. I should had use '-n' option for the
echo command, or I just should left the 'printf' statement in but I
couldn't get it to work for me!:-( 'printf' has a lot more options than
'echo', so I thought I would keep it simple with 'echo'. Thank you for
pointing that out!
chesucat
--
chesucat@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
Interpreter, n.:
One who enables two persons of different languages to
understand each other by repeating to each what it would have been to
the interpreter's advantage for the other to have said.
-- Ambrose Bierce, "The Devil's Dictionary"
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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 5383
***************************************