[8399] in Perl-Users-Digest
Perl-Users Digest, Issue: 2016 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 4 01:07:26 1998
Date: Tue, 3 Mar 98 22:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 3 Mar 1998 Volume: 8 Number: 2016
Today's topics:
Re: "Learning Perl" or "Programming Perl" <benbean@ionet.net>
Re: $0: which OSes? <webmaster@fccjmail.fccj.cc.fl.us>
Re: Controlling TWO input files (merging) (Jeff Yoak)
Re: Custom headers to solve conflict in this Newsgroup <Russell_Schulz@locutus.ofB.ORG>
Re: Custom headers to solve conflict in this Newsgroup (John Moreno)
Re: Display highest number (Gabor)
Re: Display highest number (Chuck Stewart)
Re: Display highest number <jdf@pobox.com>
Re: Display highest number (Chuck Stewart)
Re: http:// replacement <webmaster@fccjmail.fccj.cc.fl.us>
Re: Killfile Triage (Avoid normal situations.)
Re: NOT matching a string (Thomas L. Shinnick)
Perl Scripts for NT server <nhscott@enternet.com.au>
Re: Perl Scripts for NT server <tegels@home.com>
Perl to Web Download on the fly? (Jason Hellwege)
Re: Perl to Web Download on the fly? <marty@marty.net>
Perl win 32 absolute path probs <lkasdorf@pressroom.com>
Question : forms processing in perl - newbie question (Av8oR)
Re: QUIZ: answer and hash slice tutorial <webmaster@fccjmail.fccj.cc.fl.us>
Re: rsh a continuous unix command remotely <webmaster@fccjmail.fccj.cc.fl.us>
Re: The -w switch (was Re: better way to do this?) <tchrist@mox.perl.com>
Re: The -w switch (was Re: better way to do this?) (Danny Aldham)
Re: What does this one-liner do? <metcher@spider.herston.uq.edu.au>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 03 Mar 1998 23:09:00 -0600
From: Benjamin Smith <benbean@ionet.net>
Subject: Re: "Learning Perl" or "Programming Perl"
Message-Id: <6dinik$lru$1@ionews.ionet.net>
Thanks for your opinions everyone... I guess I'm gonna have to shell out
for more than one book... The Camel and one more basic level. I'll have
to hit the store and read through your suggestions.
I have to say though, Tom Christiansen's behaviour on this newsgroup has
put me off putting money in his pocket. I love my other O'Reilly
books... it's a pity he's causing me to debate purchasing another.
But that's another thread entirely >-)
------------------------------
Date: Wed, 04 Mar 1998 04:43:16 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: $0: which OSes?
Message-Id: <34FCDAAE.91968348@fccjmail.fccj.cc.fl.us>
Hmmm, that's funny, on my Solaris 2.5.1 $0 reflects the ENTIRE name of the
program as invoked...
Bill
Gautam Srikanth wrote:
> Found in perlfaq8:
>
> >>>
> To actually alter the visible command line, you can assign to the
> variable $0 as documented in the perlvar manpage. This won't work on all
> operating systems, though. Daemon programs like sendmail place their
> state there, as in:
>
> $0 = "orcus [accepting connections]";
> >>>
>
> And the question... under which OSes will ps reflect the changed command
> line? In my testing
>
> - Linux 2.0.33 does
> - Solaris 2.5.1 and HP/UX 9.05 do not.
>
>
> Anyone know why this happens? Better yet, is there a workaround for
> systems where modifying $0 fails?
>
>
> thanks in advance --
>
> Gautam
------------------------------
Date: Wed, 04 Mar 1998 02:45:22 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Controlling TWO input files (merging)
Message-Id: <6difjp$um@sjx-ixn11.ix.netcom.com>
[posted and emailed]
gbacon@cs.uah.edu (Greg Bacon) wrote:
>That's because
> while (<HANDLE>) {
>is equivalent to
> while (defined($_ = <HANDLE)) {
>It's unfortunate for you that there's not convenient shorthand notation
>for merging two files, so you'll have to do it manually:
> while (defined($a = <FIRST>) && defined($b = <SECOND>)) {
> chomp($a, $b);
>
> print "$a $b\n";
> }
>
> ## catch files of differing lengths
> if (defined $a and not defined $b) {
> print $a, <FIRST>;
> }
> elsif (not defined $a and defined $b) {
> print <SECOND>;
> }
>See if you can figure out the reason for the asymmetry in the
>if/elsif pair at the end.
Greg,
I see the reason for the asymmetry in that if SECOND empties first you
still have an $a that didn't get printed while if FIRST emptied first
the second half of the expression didn't get evaluated so there is no
$b yet.
What I don't see is how you're catching files of differing lengths.
It seems like you'd only print one line. Will the filehandles...
That's cool. print takes a list so <FIRST> and <SECOND> are taken in
an array context. I find myself starting to post questions like this
about 10 times as often as I actually post them because I find the
answer in the docs before I get it out. I'm going to let this one
slide because you bothered to call attention to the asymmetry in the
if statement which is something anyone used to looking at algorithms
(or programming in C) would likely notice but this is a cool idiom
that at least I haven't seen.
Cheers,
Jeff
-------------------------------
Jeff Yoak jeff@yoak.com
------------------------------
Date: Wed, 4 Mar 1998 01:51:35 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Custom headers to solve conflict in this Newsgroup (was Re: if you're going to answer FAQs)
Message-Id: <19980304.015135.5G4.rnr.w164w@locutus.ofB.ORG>
phenix@interpath.com (John Moreno) writes:
> Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
>
>> the problem I mentioned is dealing with a bimodal person where half
>> of the posts are useful, and half are the same rote text.
>>
>> we just want to easily ignore the rote text ones.
>
> Well, I'd like to ignore both - both the question and the answers
that's not what I was talking about. this person doesn't post questions.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Wed, 4 Mar 1998 00:26:33 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Custom headers to solve conflict in this Newsgroup (was Re: if you're going to answer FAQs)
Message-Id: <3764671B46D28433.D58DAC9CC7417ED8.9182A6EEE5BD6760@library-proxy.airnews.net>
Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
> phenix@interpath.com (John Moreno) writes:
>
> > Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
> >
> >> the problem I mentioned is dealing with a bimodal person where half
> >> of the posts are useful, and half are the same rote text.
> >>
> >> we just want to easily ignore the rote text ones.
> >
> > Well, I'd like to ignore both - both the question and the answers
>
> that's not what I was talking about. this person doesn't post questions.
That person may not, but others do. And (unless it's a really good
flame) I don't want to see the response to FAQ, either. But what I'm am
suggesting is that we set up a way to keep the FAQ from getting asked -
or at least being seen, and that we set up a way to avoid seeing the
answers to those FAQ if somebody choses to answer them.
Kill articles without a specific X header/sig message. Kill articles
with a SEEFAQ in the subject.
--
John Moreno
I am trying to convince the author of YA-NewsWatcher that the latest
version should be released to the public. He doesn't think there's much
interest in a new version. Help me prove him wrong. To do so, send me
mail <mailto:phenix@interpath.com> with a Subject of New YA. Comments
on what you like/dislike in the current version will be appreciated.
------------------------------
Date: 4 Mar 1998 03:15:40 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Display highest number
Message-Id: <slrn6fpidv.5l1.gabor@vnode.vmunix.com>
In comp.lang.perl.misc, Chuck Stewart <cstewart@flash.net> wrote :
# I have a tab delimited file with a name and 10 numbers (dupe number is
# possible).
#
# jack 77 45 45 12 90 etc
# jill 90 44 29 87 34 etc
#
# What I need to do is write to a file jack and jill's highest 3
# numbers. My sort knowledge is limited. Help is appreciated. Thanks
# so much....
while(<DATA>) {
chop;
@foo = split /\t/,$_;
@foo = ($foo[0],sort {$b <=> $a} @foo[1 .. $#foo]);
print "@foo[0 .. 3]\n";
}
__END__
jack 77 45 45 12 90
jill 90 44 29 87 34
------------------------------
Date: Wed, 04 Mar 1998 03:38:37 GMT
From: cstewart@flash.net (Chuck Stewart)
Subject: Re: Display highest number
Message-Id: <34fccca7.10442461@news.flash.net>
Thank You.
On 4 Mar 1998 03:15:40 GMT, gabor@vmunix.com (Gabor) wrote:
>In comp.lang.perl.misc, Chuck Stewart <cstewart@flash.net> wrote :
># I have a tab delimited file with a name and 10 numbers (dupe number is
># possible).
>#
># jack 77 45 45 12 90 etc
># jill 90 44 29 87 34 etc
>#
># What I need to do is write to a file jack and jill's highest 3
># numbers. My sort knowledge is limited. Help is appreciated. Thanks
># so much....
>
>while(<DATA>) {
> chop;
> @foo = split /\t/,$_;
> @foo = ($foo[0],sort {$b <=> $a} @foo[1 .. $#foo]);
> print "@foo[0 .. 3]\n";
>}
>__END__
>jack 77 45 45 12 90
>jill 90 44 29 87 34
------------------------------
Date: 03 Mar 1998 22:47:20 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Display highest number
Message-Id: <lnurung7.fsf@news.concentric.net>
cstewart@flash.net (Chuck Stewart) writes:
> What I need to do is write to a file jack and jill's highest 3
> numbers. My sort knowledge is limited.
Did you miss the documentation for the "sort" builtin? Checkout the
perlfunc document, and search for "sort."
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Wed, 04 Mar 1998 03:56:23 GMT
From: cstewart@flash.net (Chuck Stewart)
Subject: Re: Display highest number
Message-Id: <34fcd0b3.11478510@news.flash.net>
On 03 Mar 1998 22:47:20 -0500, Jonathan Feinberg <jdf@pobox.com>
wrote:
>cstewart@flash.net (Chuck Stewart) writes:
>
>Did you miss the documentation for the "sort" builtin?
no.
------------------------------
Date: Wed, 04 Mar 1998 04:30:01 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: http:// replacement
Message-Id: <34FCD793.FC2EB4BA@fccjmail.fccj.cc.fl.us>
Hmmm. I, always wondered where she was hiding :-)
]> Abigail wrote:
]> http://cthulhu.mandrake.net/~abigail/Perl/url.html
Bill :-)
------------------------------
Date: Wed, 4 Mar 1998 04:17:09 GMT
From: seento@netcom.com (Avoid normal situations.)
Subject: Re: Killfile Triage
Message-Id: <seentoEpA18L.JvF@netcom.com>
st. paul's wort (rone+usenet@ennui.org) wrote:
: In article <34f3a2b6.925899@news.omen.net.au>,
: peter caffin <synic@omen.net.au> wrote:
: >I simply do not see what the fuss is about. Sighting nospam_ masks in From:
: >headers during a reply is trivial (unless you happen to be writing a spam-bot
: >which does your replying for you).
: From: <synic@omen.net.ua>
: From: <synic@omen.net.ua>
: From: <synic@omen.net.ua>
: rone
: go go gadget spambots!
*plonk*
--
The Stainless "it had to be said" Steel Moviegoer
"There's a hatred of art, a hatred of literature -- I mean of the genuine
kind. Oh the shams -- *those* they'll swallow by the bucket!"
-- Henry James, _The Author of Beltraffio_
------------------------------
Date: Wed, 04 Mar 1998 04:07:46 GMT
From: tshinnic@io.com.mapSoN (Thomas L. Shinnick)
Subject: Re: NOT matching a string
Message-Id: <34fcd171.25865602@news.io.com>
On 03 Mar 1998 15:24:09 -0500, Uri Guttman <uri@sysarch.com> wrote:
>bring me the head of bill gates before you ask another one!
How 'bout just his lips?
>miko@idocs.com writes:
>> For the string "X hi there temp test" it would find "X hi there temp ".
>> For the string "Xtest" it would find "X".
>> For the string "Xtetetest" it would find "Xtete".
>> I have tried
>> /X(?!test)/
>you are close but no cigar. you don't have anything to match the text
>BETWEEN X and test. you just match X followed by not 'test'. nothing
>try this (tested)
>/(X.*)test/
>print $1 ;
>this works on all your examples.
But it would be good to remind miko that this may do _more_ than
he asked for. If his string was
"X hi there temp test or not to test"
then /(X.*)test/ matches "X hi there temp test or not to ",
but /(X.*?)test/ will just match "X hi there temp ".
------------------------------
Date: Wed, 4 Mar 1998 14:52:57 +1000
From: "NT connection" <nhscott@enternet.com.au>
Subject: Perl Scripts for NT server
Message-Id: <6dij7q$g7r$1@perki.connect.com.au>
Hi, does anyone know of a good site to find perl Scripts for doing such
things as creating users, administering the box, etc.
Thanks
Nick.
------------------------------
Date: Tue, 3 Mar 1998 22:17:06 -0600
From: "Kent L. Tegels" <tegels@home.com>
Subject: Re: Perl Scripts for NT server
Message-Id: <6dikjs$s0n$1@ha2.rdc1.ne.home.com>
How about. www.activestate.com...
------------------------------
Date: 4 Mar 1998 03:19:06 GMT
From: glecjh@luff.latrobe.edu.au (Jason Hellwege)
Subject: Perl to Web Download on the fly?
Message-Id: <4134.1323101245.1150210@news.latrobe.edu.au>
Unless there's something obvious in HTML which I'm missing, here's what
I want to do in Perl:
I have a Perl based web-database application, I want to add a facility
so that users can perform a search, click on "Download Results File"
and output a comma seperated file which will download to their computer
and open in Excel.
I could write lots of files to some area on my server and have the
users download them from there, but the file maintenance is a pain. I
would like to have Perl just write and output the file/download on the
fly.
Assuming that this is possible, any suggestion for how I can tackle
this?
TIA
Jason
______________________________________________________________________
Jason Hellwege "Vince would go seriously mad about
La Trobe University, Melbourne, once a month....and less seriously
Australia. Jason.H@latrobe.edu.au mad, about three times a month..."
______________________________________________________________________
------------------------------
Date: Tue, 03 Mar 1998 19:55:05 -0800
From: Marty McKolskey <marty@marty.net>
Subject: Re: Perl to Web Download on the fly?
Message-Id: <34FCD099.92565E70@marty.net>
I don't know the specifics of formatting an Excel file, however:
print "Content-type: application/msexcel\n";
print "Content-Disposition: attachment; filename=$filename.xls\n";
print "Content-Description: $description\n\n";
foreach $line(@file) {
print "$line";
}
Try that out.
Marty
--
my $name = 'Marty';
my $email = 'marty@marty.net';
last;
Jason Hellwege wrote:
>
*snip*
> I have a Perl based web-database application, I want to add a facility
> so that users can perform a search, click on "Download Results File"
> and output a comma seperated file which will download to their computer
> and open in Excel.
> ______________________________________________________________________
> Jason Hellwege "Vince would go seriously mad about
> La Trobe University, Melbourne, once a month....and less seriously
> Australia. Jason.H@latrobe.edu.au mad, about three times a month..."
> ______________________________________________________________________
------------------------------
Date: Wed, 4 Mar 1998 00:50:17 -0500
From: "Lynn Kasdorf" <lkasdorf@pressroom.com>
Subject: Perl win 32 absolute path probs
Message-Id: <6diq76$ams$1@usenet47.supernews.com>
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01BD4707.80345B60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm making mods to a massive perl project running under Digital Unix. I =
am running NT 4.0 and ActiveState Perl for win32, build 315.
=20
The problem is, I can find no way of referring to files using absolute =
paths.
=20
The code has this sort of thing...
=20
$XYZROOT =3D "/usr/local/etc/httpd/htdocs/xyz";=20
$CFdatadir =3D "$XYZROOT/data";
$CFfrenlnfile =3D "$CFdatadir/xyzenglink.txt";
open(LINKFILE,$CFfrenlnfile) || die "Can't open $CFfrenlnfile";
=20
This runs under unix, but fails under NT. If I make this change, it =
works...
=20
$CFfrenlnfile =3D ../data/xyzenglink.txt";
=20
...since the perl file containing all this is in a sibling directory of =
the data directory.
=20
Basically, I can only do relative file paths. No permutation of an =
absolute path works. I put a text file at the server root of my machine =
and try to open it. All of these examples fail. (my server is called =
"entropy")
=20
open (TESTFILE, "http://entropy/test.txt");
open (TESTFILE, "/entropy/test.txt");
open (TESTFILE, "entropy/test.txt");
open (TESTFILE, "http://localhost/test.txt");
open (TESTFILE, "/localhost/test.txt");
open (TESTFILE, "localhost/test.txt");
=20
What gives???
Lynn Kasdorf
------=_NextPart_000_0011_01BD4707.80345B60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>I'm making mods to a massive perl =
project=20
running under Digital Unix. I am running NT 4.0 and ActiveState Perl for =
win32,=20
build 315.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>The problem is, I can find no way of =
referring=20
to files using absolute paths.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>The code has this sort of =
thing...</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 =
size=3D2>$XYZROOT =3D=20
"/usr/local/etc/httpd/htdocs/xyz"; </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT=20
size=3D2>$CFdatadir =3D=20
"$XYZROOT/data";</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>$CFfrenlnfile =3D=20
"$CFdatadir/xyzenglink.txt";</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>open(LINKFILE,$CFfrenlnfile) || die =
"Can't=20
open $CFfrenlnfile";</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>This runs under unix, but fails =
under NT. If I=20
make this change, it works...</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2>$CFfrenlnfile =3D=20
../data/xyzenglink.txt";</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>...since the perl file containing =
all this is in=20
a sibling directory of the data directory.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>Basically, I can only do relative =
file paths. No=20
permutation of an absolute path works. I put a text file at the server =
root of=20
my machine and try to open it. All of these examples fail. (my server is =
called=20
"entropy")</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>open (TESTFILE, "<A=20
href=3D"http://entropy/test.txt">http://entropy/test.txt</A>");</FON=
T></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>open =
(TESTFILE,=20
"<U><FONT color=3D#0000ff>/</FONT></U><A=20
href=3D"http://entropy/test.txt">entropy/test.txt</A>");</FONT></FON=
T></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>open =
(TESTFILE,=20
"<A=20
href=3D"http://entropy/test.txt">entropy/test.txt</A>");</FONT></FON=
T></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2>open (TESTFILE, "<A=20
href=3D"http://localhost/test.txt">http://localhost/test.txt</A>");<=
/FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>open =
(TESTFILE,=20
"<U><FONT color=3D#0000ff>/</FONT></U><A=20
href=3D"http://entropy/test.txt">localhost/test.txt</A>");</FONT></F=
ONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>open =
(TESTFILE,=20
"<A=20
href=3D"http://entropy/test.txt">localhost/test.txt</A>");</FONT></F=
ONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000=20
size=3D2></FONT></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000 size=3D2>What=20
gives???</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT color=3D#000000=20
size=3D2></FONT></FONT> </DIV>
<DIV><FONT color=3D#000000 face=3D"" size=3D2>Lynn=20
Kasdorf</FONT></DIV></FONT></FONT></DIV></FONT></FONT></DIV></FONT></FONT=
></DIV></FONT></DIV></DIV></BODY></HTML>
------=_NextPart_000_0011_01BD4707.80345B60--
------------------------------
Date: Wed, 04 Mar 1998 05:12:10 GMT
From: Av8oR75@hotmail.com (Av8oR)
Subject: Question : forms processing in perl - newbie question
Message-Id: <34ffe217.16138460@news.alt.net>
How would I parse a textarea field read form an html page so that when
I write it out to the server I can format it as 40 character lines and
capture and cr/lf's that may have been input. Any help on this would
be greatly appreciated
------------------------------
Date: Wed, 04 Mar 1998 04:41:00 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: QUIZ: answer and hash slice tutorial
Message-Id: <34FCDA26.D1FAB49B@fccjmail.fccj.cc.fl.us>
Hmmm. Since Perl was originally targeted to C programmers, maybe
a start at the beginning would prove helpful for a 'beginners Quiz?'
Something like -
my($removeHostAddr) = substr(remote_addr, (rindex(remote_addr(),".")));
Q1. What do you (ng readers not Uri, per se) think it does?
Q2. How would that be written as a RegEx???
Bill
PS - No, I can't rewrite it, that's 'another' reason why I am asking :-)
And yes, I know what it does :-) I wrote it.
Uri Guttman wrote:
> well, it goes to show you that when you try to inject something useful
> into this group, it fails. i had only 2 (TWO) respondants to my
> quiz.
<array assignments snipped...>
------------------------------
Date: Wed, 04 Mar 1998 04:48:15 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
To: Farid Hamjavar <hamjavar@unm.edu>
Subject: Re: rsh a continuous unix command remotely
Message-Id: <34FCDBD9.C59FDB23@fccjmail.fccj.cc.fl.us>
Mailed and Posted:
I understand that :-) What I am saying is How are you reviewing what
was captured on rsh? I captured mine as illustrated. I aplogize for not
being clearer :-) Either way you have a data file to look at. How are
you looking at your data?
Bill
> Example:
> I want to capture never-ending output
> of "netstat 2" on host "B" into a
> nfs-accessible file named COLLECT by
> rsh-ing from host "A" without even touching
> host "B" other than the fact that I
> need to rsh into it.
>
> The shell version which is already working
> is like this which gets "re-spawned" via
> unix's initialization table (inittab in aix)
>
> #!/bin/ksh
> junkfile=/scratch/junk
> if [ -f ${junkfile} ]
> then
> > ${junkfile}
> rsh remotehost netstat 2 1>>${junkfile} 2>&1
> else
> touch ${junkfile}
> fi
>
> Thanks,
> Farid
PS - Where is the data going? I don't see it, except in a junkfile.
Bill
------------------------------
Date: 4 Mar 1998 03:32:15 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: The -w switch (was Re: better way to do this?)
Message-Id: <6dihvv$7jr$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Zenin <zenin@best.com> writes:
: I *highly* disagree this advice for some uses. When left in CGI
: code, it can be deadly.
Why aren't you using CGI::Carp??
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
echo "Hmmm...you don't have Berkeley networking in libc.a..."
echo "but the Wollongong group seems to have hacked it in."
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 4 Mar 1998 03:46:20 GMT
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: The -w switch (was Re: better way to do this?)
Message-Id: <6diiqc$ce3$1@lennon.postino.com>
X-Newsreader: TIN [version 1.2 PL2]
On Tue, 03 Mar 1998 18:55:35 GMT, gaj wrote:
>Why the fsck would Larry make -w and use strict optional?
I have fired up too many programs that used a CPAN module
and start by listing half a screen of error messages about
uninitialized variables to want -w in production code.
--
Danny Aldham SCO Ace, MCSE, JAPH, DAD
Field Service Manager BCTel Systems Support
7000 Lougheed Hwy, Burnaby BC (604) 444-8949
------------------------------
Date: Wed, 04 Mar 1998 14:07:08 +1100
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: What does this one-liner do?
Message-Id: <34FCD36C.939EF39F@spider.herston.uq.edu.au>
Chipmunk, I like your explanation, but...
I don't really have a problem with perl's behaviour in this regard. I'm
just trying to figure out if I have a problem with the documentation.
I've indulged in some more hairsplitting below, if you've the patience
to educate me further.
Chipmunk wrote:
>
> Jaime Metcher wrote:
> >
snip
> > In the example
> >
> > ($a, $b, $c) = (7, 8, 9);
> >
> > what is "the variable"? If I do:
>
> There is no "the variable" because this is a list assignment. See above.
You're right, of course, but I think the docs are using "the variable"
as a euphemism. I should have said:
my @list = (7,8,9);
Isn't @list the variable? And my example below demonstrates that the
value of the assignment (in list context) is the value of the LHS -
which is usually where we put "the variable". I think the quote from
the Camel is saying "the new value of the variable" where it means "the
value assigned to the LHS".
>
> > perl -e "print (join (':', ($a, $b) = (7, 8, 9)))"
> >
> > I get:
> >
> > 7:8
> >
> > which seems to imply that the "variable" is the LHS, which becomes
> > (7,8). I've added $b to make it completely clear that the assigment is
> > evaluating to a list, and that it evaluates to the list on the LHS.
>
snip
> The 'in all cases' rule is 'in all cases of scalar assignment'. It does not
> apply to list assignment.
I *know* that's what it means to say, but I'm not sure if that's what it
*is* saying. My point in this discussion is this: when I read the
original post in this thread, and then looked up the Camel, I could see
*immediately* why the poster was led astray. "It does not apply to list
assignment" - that sentence is clear, unambiguous, and missing from the
Camel. Up until the last paragraph, there's no mention of context in
the "Assignment Operators" section. More pedantry on my part, I suppose
- I'd be happier if the last paragraph said "This is an exception". Or
if the first part said "This is only for scalar context".
>
> > "The value of an assignment is the the value that gets assigned to the
> > LHS, except where the assignment is a list assignment in a scalar
> > context. In this case, the value of the assignment is the value of the
> > RHS."
>
> No, in that case, the value of the assignment is *the number of values* in the RHS.
If we say the value of the list assignment in scalar context is the
value of the RHS, and the RHS is a list, then the value of the list in
scalar context *is* the number of values in the RHS. But this might be
ambiguous where the RHS is a scalar being assigned to a list.
>
> You are attempting to make a rule which covers both scalar and list
> assignment. There are already rules that cover scalar and list assignment
> separately. Trying to make a single rule only confuses the issue.
>
I just might agree with you!
--
Jaime Metcher
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2016
**************************************