[8585] in Perl-Users-Digest
Perl-Users Digest, Issue: 2202 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 28 23:07:32 1998
Date: Sat, 28 Mar 98 20:00:25 -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 Sat, 28 Mar 1998 Volume: 8 Number: 2202
Today's topics:
Re: caller(), $wantarray, and void context (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Re: CGI - Multiple values in an associative array <rootbeer@teleport.com>
Re: File Missing (Alan Barclay)
filtering disruptive characters in win32 <nix@cyberramp.net>
Re: Flogging a Dead Horse Re: Primes via regexen <scribble@pobox.com>
Re: Flogging a Dead Horse Re: Primes via regexen <scribble@pobox.com>
Re: HELP! Decimal point character in Perl 4 on SCO Unix rhardin@planethollywood.com
Re: London.pm (brian d foy)
Perl Cgi Questions <mglenn@no.spam.zbzoom.net>
Re: PROPOSAL: The Perl Dictionary (Jeffrey Drumm)
Re: proposal: while $line (<FILE>) <scribble@pobox.com>
Re: rant: illiterate Perl programmers (Michael Fuhr)
Re: rant: illiterate Perl programmers (Craig Berry)
Re: Redirect URL <andrew@boothman.easynet.co.uk>
Re: Sysadmin struggeling with PERL/Sed and etc... (Michael Fuhr)
Re: Sysadmin struggeling with PERL/Sed and etc... <dave@dmriley.demon.co.uk>
Re: Sysadmin struggeling with PERL/Sed and etc... <akravchenko@bny18.bloomberg.com>
Re: What does -f do? (Abigail)
Re: What does -f do? (I R A Aggie)
Re: What does this mean =~ ? <gwynne@utkux.utk.edu>
Re: What does this one liner do? <rootbeer@teleport.com>
Re: What does this one liner do? <mhanson@arrowweb.com>
Re: What does this one liner do? <flavell@mail.cern.ch>
Re: What does this one liner do? (Abigail)
Re: What does this one liner do? <ebohlman@netcom.com>
Re: What does this one liner do? <scribble@pobox.com>
Re: what is wrong with being a novice ?? (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 28 Mar 1998 23:37:32 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: caller(), $wantarray, and void context
Message-Id: <lassehp-2803982337330001@ygdrasil.imv.aau.dk>
In article <ken-2703981746190001@news.swarthmore.edu>,
ken@forum.swarthmore.edu (Ken Williams) wrote:
>My wantarray function doesn't do the same thing. It doesn't distinguish
>between a scalar and void context, as the following test program
>demonstrates.
>_________________________________________
>Output:
>wantarray:
>wantarray: 1
>wantarray:
>caller: 0
>caller: 1
>caller:
>_________________________________________
~(41) perl -w contexttext
wantarray:
wantarray: 1
Use of uninitialized value at contestorig line 12.
wantarray:
caller: 0
caller: 1
Use of uninitialized value at contestorig line 17.
caller:
Hmm. Note the first line of output? No warning? What *exactly* does this
demonstrate?
Try this test:
#! perl -w
$var = &context_using_wantarray('arg');
@var = &context_using_wantarray('arg');
&context_using_wantarray('arg');
print "scalar context: ";
$var = &context_using_caller('arg');
@var = &context_using_caller('arg');
&context_using_caller('arg');
sub context_using_wantarray {
$context = wantarray;
print ("wantarray: $context\n") if defined $context and $context ne "";
print ("wantarray: undef\n") if not defined $context;
print ("wantarray: empty string\n") if defined $context and $context
eq "";
}
sub context_using_caller {
my $context = (caller(0))[5];
print ("caller: $context\n") if defined $context;
print ("caller: undef\n") if not defined $context;
}
Now, why caller(0))[5] is a real zero, while wantarray is an empty string,
I don't know. But with wantarray, you _can_ distinguish between scalar and
void, just as it says in perldoc -f wantarray. "" is a nice short way to
represent FALSE.
Nothing but a string is more than nothing at all, at the beach, and in Perl.
-Lasse
------------------------------
Date: Sat, 28 Mar 1998 15:40:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Pete & Kitty <dieter@minn.net>
Subject: Re: CGI - Multiple values in an associative array
Message-Id: <Pine.GSO.3.96.980328153603.29336H-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Pete & Kitty wrote:
> Subject: CGI - Multiple values in an associative array
CGI - If this is a CGI question, you should ask it in a newsgroup about
CGI scripting; this newsgroup is about Perl. (Although your CGI script may
be written in Perl, that doesn't mean that questions about CGI scripting
are Perl questions.)
Associative array - We call them "hashes" now.
> $display_it=$item( "*:Ordway:*" );
>
> - or would that fail since there would be multiple matches
That would fail because it's syntactically invalid.
> is it possible in perl to have 'an array within an array' -
Check the perlref, perldsc, and perllol manpages.
> - but what kind of strain does that put on the server?
Perl doesn't care. :-) But you could ask in a newsgroup about servers, if
that's what you need.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Mar 1998 00:36:43 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: File Missing
Message-Id: <891131795.120478@elaine.drink.com>
In article <6fbslv$h5s$1@ns1.arlut.utexas.edu>,
Stuart McDow <smcdow@arlut.utexas.edu> wrote:
>miller@bigsky.net (Keith L. Miller) writes:
>> I can't seem to figure out how to set a variable (say $missing) to a
>> value of 1 if a file is not found with an OPEN statement or a 0 if it
>> is found. Can anyone help please?
>
>You should probably check to see if the file exists before you try to
>open it.
>
>To do exactly what you want,
>
>$missing = ( not -e "file" ) || 0;
>
>Although it would be better to use -r or -R (or -w or -W) instead.
No, this is the wrong approach. You are leaving yourself open
to race conditions here - where the code's idea of the outside world
is wrong because the outside world changes while it runs.
If some other program on the system deletes or changes the file's
permissions between the test and the open, then the open could fail
even though the test was successful. If you don't also test the open,
then your program can continue on doing lots of damage. If you do
test the open, then the earlier test was redundant.
The other suggestions in this thread are in general the correct
approach. Attempt the open, and use the result of that open as the test.
As there is only one call (the open), there is no chance of the file
changing.
The exception is when you wish to create a file only if it doesn't
already exist. In this case it's more complex, and under Unix the easiest
approach in perl is to create a temporary file and use rename to attempt
to rename it.
As the perl rename (correctly) overwrites the target file if it exists,
you have to do it manually, ie
if(link $old,$new){
print "Rename succeeded\n";
} else {
print "Rename failed\n";
}
unlink($old);
------------------------------
Date: 28 Mar 1998 23:30:11 GMT
From: "Leah Norman" <nix@cyberramp.net>
Subject: filtering disruptive characters in win32
Message-Id: <01bd5aa1$1f52da80$34629ecf@nix>
I am using Perl for Win32. I am processing data files that are mostly text
but have hex 1A (EOF?) characters scattered throughout. I have found that
if I open the file in binmode, use s/\x1A//g on each buffer load, and save
the whole thing to a temp file, I can then process the temp file as normal
text. Otherwise, the line processing will end at the first x1A
encountered.
There's got to be a better way to do this ( hopefully not involving a temp
file). Any suggestions?
------------------------------
Date: 28 Mar 1998 16:42:40 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: Flogging a Dead Horse Re: Primes via regexen
Message-Id: <6fjud0$hmr@tekka.wwa.com>
tchrist@mox.perl.com writes:
>
>And here's this:
>
> # factor
> for ($N = shift; (1 x $N) =~ /^(11+?)\1+$/; $N /= $factor) {
> print $factor = length($1), " ";
> }
> print "$N\n";
An operation on numbers! Shocking! Shouldn't it be:
for ($N = 1 x shift; $N =~ /^(11+?)\1+$/; $N =~ s/$1/1/g) {
print length($1), " ";
}
print length($N), "\n";
------------------------------
Date: 28 Mar 1998 21:56:09 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: Flogging a Dead Horse Re: Primes via regexen
Message-Id: <6fkgop$ijk@tekka.wwa.com>
scribble@pobox.com writes:
>An operation on numbers! Shocking! Shouldn't it be:
>
> for ($N = 1 x shift; $N =~ /^(11+?)\1+$/; $N =~ s/$1/1/g) {
> print length($1), " ";
> }
> print length($N), "\n";
I am ashamed and disgusted with the ugly numerical function "length".
One should use the string function "base10".
sub base10 {
my $digits = "";
local $_ = shift;
{
s/1111111111/2/g;
$digits =~ s!^!("0".."9")[s/1//g||0]!e;
redo if y/2/1/;
}
$digits;
}
------------------------------
Date: Sat, 28 Mar 1998 21:02:44 -0600
From: rhardin@planethollywood.com
Subject: Re: HELP! Decimal point character in Perl 4 on SCO Unix
Message-Id: <6fkdf3$7oo$1@nnrp1.dejanews.com>
In article <6fjeph$f0q$1@nnrp1.dejanews.com>,
rhardin@planethollywood.com wrote:
>
>.....Is there any quick and/or simple way to tell perl4
> to use a period instead of a comma as the decimal point in printf/sprintf
> functions?
OK, so I'm answering my own question. Some digging in comp.unix.sco.misc
pointed me towards environment variable LC_NUMERIC. This parameter is
mentioned in the Perl 5 doc under locale handling, but is not clearly
explained. If you set and export LC_NUMERIC to "C", then the ANSI C numeric
representation overrides any locale settings. For example, a perl script
'testscript.pl' on the French SCO system that does:
printf ("%.2f\n", 0);
outputs 0,00
run the same perl script after setting LC_NUMERIC:
LC_NUMERIC=C; export LC_NUMERIC
perl testscript.pl
outputs 0.00
Shazam!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sat, 28 Mar 1998 21:38:05 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: London.pm
Message-Id: <comdog-ya02408000R2803982138050001@news.panix.com>
Keywords: from just another new york perl hacker
In article <351f0966.3749808@news.demon.co.uk>, dave@mag-sol.com (Dave Cross) posted:
>I've seen a few posts here recently talking about various Perl
>M[ou]ngers groups in the US, but nothing about the UK. I visited
>www.pm.org to see if anyone else had registered an interest, but the
>search facility had been switched off.
i think we have decided to leave the search thing off - there were
too many concerns with address harvesting which we couldn't address
to our satisfaction. however, at the bottom of that page [1] there is
a form that let's you see the number of registrants for a
particular place. we'll release those names to the person that steps
forward to organization a group in that area.
for those people are interested in forming a group in their area,
they can register their interest at
<URL:http://www.pm.org/register.html>
>Has anyone given any thought to starting a London.pm or UK.pm group?
actually, we were going to target London as the first non-USA group :)
once you get going, send me a note and get the usual Perl Mongers
benefits going for you. in particular, we'll list established and
forming groups and their contact information on
<URL:http://www.pm.org/groups.html>
good luck :)
[1] See the Distribution - very bottom of the page
<URL:http://www.pm.org/register.html>
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Sat, 28 Mar 1998 16:12:12 -0800
From: "Mike Glenn" <mglenn@no.spam.zbzoom.net>
Subject: Perl Cgi Questions
Message-Id: <6fjt5q$fum$1@news0-alterdial.uu.net>
First:
I have a script that excepts POST data from a TextArea. I would like to
spell check this data before it is written to file. Does anyone know where I
can get a Module to do this? I checked CPAN but didn't see anything that fit
the bill.
Second:
I would also like to parse the above data for web URL's and email addresses
and then add the aproprate tags. So when the data is rewritten on a web
page, what I typed is displayed as a link. (Similar to what Outlook Express
does).
Thanks in advance...
Mike Glenn
mglenn@zbzoom.net
------------------------------
Date: Sat, 28 Mar 1998 22:43:08 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <351d7a6f.2135152@news.mmc.org>
My contribution . . .
liperlsuction: What happens to any script longer than 10 lines once
Randal gets his hands on it
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center Information Services
420 Cumberland Ave, Portland, ME 04101
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me
------------------------------
Date: 28 Mar 1998 20:49:22 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: proposal: while $line (<FILE>)
Message-Id: <6fkcri$d3s@tekka.wwa.com>
mike@stok.co.uk writes:
>perl gives you enough rope to hang yourself. There are plenty of other
>languages which keep the rope safely locked away...
It almost sounds like you are bragging about it...
How can listing a man page be an answer to a *proposal*?
------------------------------
Date: 28 Mar 1998 15:27:55 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: rant: illiterate Perl programmers
Message-Id: <6fjthb$9ph@flatland.dimensional.com>
nick@NOSPAMTHANKSciof.sbcc.net (Nick Tonkin) writes:
> On 28 Mar 1998 14:47:39 GMT, laird@dock.ecn.purdue.edu (Kyler Laird)
> wrote:
>
> >Hal Snyder <hal@vailsys.com> writes:
> >
> >>It's not just Perl programmers - "it's"/"its" dyslexia is endemic.
> >
> >>What's next? Her's and your's?
>
> How about the UMAX scanning software I installed yesterday telling me
> to "reboot before the changes take affect" . . . ?
More than once I've seen software documentation describe certain features
as "depreciated." I wonder if that means they'll be lowering the price
for the next version.
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 29 Mar 1998 00:09:54 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: rant: illiterate Perl programmers
Message-Id: <6fk3gi$59e$1@marina.cinenet.net>
Nick Tonkin (nick@NOSPAMTHANKSciof.sbcc.net) wrote:
: On 28 Mar 1998 14:47:39 GMT, laird@dock.ecn.purdue.edu (Kyler Laird)
: wrote:
:
: >Hal Snyder <hal@vailsys.com> writes:
: >
: >>It's not just Perl programmers - "it's"/"its" dyslexia is endemic.
: >
: >>What's next? Her's and your's?
:
: How about the UMAX scanning software I installed yesterday telling me
: to "reboot before the changes take affect" . . . ?
Sounds like good advice, for some apps. "Quickly! Save yourself, while
there's still time!" :-)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Fri, 27 Mar 1998 22:19:49 +0000
From: Andrew Boothman <andrew@boothman.easynet.co.uk>
To: Richard <yellow*@cix.co.uk>
Subject: Re: Redirect URL
Message-Id: <351C2605.4443F284@boothman.easynet.co.uk>
If you are using the CGI.pm module then you can simply use the
print $query->redirect('http://redirect.here')
command.
Otherwise, you'll have to find the proper HTTP commands for doing that
sort of thing.
Richard wrote:
>
> I have a perl script which is simply used to respond to a form
> submission. Exiting the perl script I wish to display a 'thank you' but from
> an html page on another server. Any suggestions on how I could do this
> please?
>
> --
> Richard Heath
--
Andrew Boothman : andrew@boothman.easynet.co.uk
(http://easyweb.easynet.co.uk/~boothman/andrew/)
"Yahoo is a search engine.
Netanyahoo is an Israeli search engine"
-Robin Williams
------------------------------
Date: 28 Mar 1998 15:36:54 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <6fju26$a2u@flatland.dimensional.com>
daclay@NOSPAMzip.com.au (Excession) writes:
> #meld
> # $ARGV[0] = file 1, $ARGV[1] = file 2, $ARGV[3] = file 3
> die "need args, stephanie!" if !defined($ARGV[0]);
> open(F1, "<$ARGV[0]") || die "invalid input filename in $ARGV[0]";
> open(F2, "<$ARGV[1]") || die "invalid input filename in $ARGV[1]";
> open(F3, ">$ARGV[2]") || die "invalid output filename in $ARGV[2]";
> while (1)
> {
> die "end of input on file 1" if !defined($line1 = <F1>);
> die "end of input on file 2" if !defined($line2 = <F2>);
> print F3 $line1, $line2;
> }
This works fine from a Unix shell:
paste file1 file2 > file3
Less typing, too :-)
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 29 Mar 1998 02:39:31 +0100
From: David Riley <dave@dmriley.demon.co.uk>
Subject: Re: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <m390pui8bw.fsf@dmriley.demon.co.uk>
"David C. McCall" <cyberman@sonoma.edu> writes:
> I've got 2 files each with the same number of lines of text.
> I would like to merge these files line by line appending the 2nd files
> 1st line to the 1st files 1st line, and so on....to a 3rd file.....
>
Using perl:
#!/usr/bin/perl
open(FILE0, "@ARGV[0]") || die "could not open file @ARGV[0]\n";
open(FILE1, "@ARGV[1]") || die "could not open file @ARGV[1]\n";
while (<FILE0>) {
print;
if ($S = <FILE1>) {print "$S";}
}
close(FILE0); close(FILE1);
# HTH
--
{ { wwWWww } } David Riley dave@dmriley.demon.co.uk
{ {(.)(.)} } http://www.dmriley.demon.co.uk
{ { | } }
{ { =} } "There is nothing incomprehensible." - Lautreamont
------------------------------
Date: 29 Mar 1998 02:10:00 GMT
From: "Alex Kravchenko" <akravchenko@bny18.bloomberg.com>
Subject: Re: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <01bd5ab5$80e343c0$33fc26cf@akravche.bloomberg.com>
A little perl script to do what you asked:
#!/usr/local/bin/perl
print "first file name: ";
$f1 = <STDIN>;
print "second file name: ";
$f2 = <STDIN>;
open(F1, $f1) || die("can not open file one");
open(F2, $f2) || die("can not open file two");
while ( chop($l1 = <F1>) && chop($l2 = <F2>) ) {
print "$l1$l2\n";
}
However, if you want to join to files on a specific field they have in
common, lookup info on join command.
David C. McCall <cyberman@sonoma.edu> wrote in article
<351D529E.E97D8E09@sonoma.edu>...
> I've got 2 files each with the same number of lines of text.
> I would like to merge these files line by line appending the 2nd files
> 1st line to the 1st files 1st line, and so on....to a 3rd file.....
>
> cyberman@sonoma.edu
------------------------------
Date: 29 Mar 1998 02:07:19 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: What does -f do?
Message-Id: <6fkacn$585$2@client2.news.psi.net>
Mike (mhanson@arrowweb.com) wrote on MDCLXX September MCMXCIII in
<URL: news:351D33B0.261B@arrowweb.com>:
++ What does -f do?
That is explained in the manual.
Abigail
--
perl -we '%_ = map {local $_ = $_; y/a-z/n-za-m/; ($_, $_)} @_ = map {lc} <>;
print grep {$_{$_}} @_' < /usr/dict/words
------------------------------
Date: Sat, 28 Mar 1998 22:48:19 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: What does -f do?
Message-Id: <fl_aggie-2803982248190001@aggie.coaps.fsu.edu>
In article <351D7DFB.22BD@arrowweb.com>, mhanson@arrowweb.com wrote:
+ Webmaster wrote:
+ > Mike wrote:
+ > > What does -f do?
I believe this to be a case where rude, sarcastic answers are in order.
You folks have been waaaaay to generous. Go have some more caffiene... :)
+ > Please expand upon your question... Many possible answers exist...
+ Like while(-f file) {
Um...this is explained on page 85 of the blue Camel book (Programming
Perl, 2nd edition). It's also explained on page 5 of the perlfunc
man page ('perldoc perlfunc'). I originally looked at the 'perldoc
perlop' page (operators, dontcha know?) but it politely made mention
of the '-f' operator and refered me to 'perlfunc'.
Which part of "the perl documentation set is included with every
distribution, and if not, then the porters of perl to your system
are being naughty and should fix their broken distribution, but you
can find HTMLized version, and even a PDF version which you can print
out and make your very own copy" are you having problems understanding?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Sat, 28 Mar 1998 21:03:52 -0500
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: What does this mean =~ ?
Message-Id: <6fka6k$5m3$1@gaia.ns.utk.edu>
Billy:
It's a binding operator. There's a detailed explanation on p. 81 of
Programming Perl. According to Ormont (Perl 5 Interactive Course), "when
used with m//, =~ resembles the equality operators == and eq because it
returns TRUE if the string on the left matches it regex and FALSE
otherwise."
For example, if you have
if ($myvar =~ m/^myword/) {
print $myvar;
}
the =~ links m/^myword/ with the string to be searched which is $myvar.
On the other hand, if it is used with s///, it is more like the assignment
operator =.
For example:
$myvar =~ s/myword/yourword/g;
replaces myword with yourword in $myvar.
Your question indicates that like all of us newbies, you need to work
through a good book. I suggest spending time and money on Ormont's Perl 5
Interactive Course which is a thorough tutorial. Then carefully read Wall,
Christiansen, and Schwartz's Programming Perl. These will get you off to a
good start. Then read over and over all of the other O'Reilly Perl books.
Bob Gwynne (a teacher--unlike Abby who is obviously not!)
University of Tennessee
Billy wrote in message <6fhi6q$jms@atlas.cs.upei.ca>...
>Does it mean match?
>Explain?
>
>Newbie
>
>
------------------------------
Date: Sat, 28 Mar 1998 15:34:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike <mhanson@arrowweb.com>
Subject: Re: What does this one liner do?
Message-Id: <Pine.GSO.3.96.980328153351.29336G-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Mike wrote:
> What does this do? select(undef,undef,undef,0.1);
What would you like to know that isn't in the docs?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 28 Mar 1998 17:28:55 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Re: What does this one liner do?
Message-Id: <351DA3D7.463B@arrowweb.com>
Ronald J Kimball wrote:
>
> Mike wrote:
> >
> > What does this do? select(undef,undef,undef,0.1);
>
> Exactly what the documentation for four-argument select() says it does.
>
> Try the perlfunc documentation or the Programming Perl book.
>
> --
> _ / ' _ / - aka - rjk@coos.dartmouth.edu
> ( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
> / http://www.ziplink.net/~rjk/
> "It's funny 'cause it's true ... and vice versa."
Can't you just tell me what it means. I don't have telenet access so i
can't get the manual. And it does not say it the perl book that i have.
------------------------------
Date: Sun, 29 Mar 1998 01:09:12 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: What does this one liner do?
Message-Id: <Pine.A41.3.95a.980329010256.120834A-100000@rsplus12.cern.ch>
On Sat, 28 Mar 1998, Mike wrote:
> Ronald J Kimball wrote:
(quotes entire posting including sig, so that we shall know what
conclusions to draw, and then says, inter alia)
> it does not say it the perl book that i have.
Book? If you've got a perl distribution, you've got the documentation.
If you haven't, then how you gonna execute the thing anyway?
perldoc perlfunc has an entry for select. Isn't it clear?
------------------------------
Date: 29 Mar 1998 02:05:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: What does this one liner do?
Message-Id: <6fka9n$585$1@client2.news.psi.net>
Mike (mhanson@arrowweb.com) wrote on MDCLXXI September MCMXCIII in
<URL: news:351DA3D7.463B@arrowweb.com>:
++ Ronald J Kimball wrote:
++ >
++ > Mike wrote:
++ > >
++ > > What does this do? select(undef,undef,undef,0.1);
++ >
++ > Exactly what the documentation for four-argument select() says it does.
++ >
++ > Try the perlfunc documentation or the Programming Perl book.
++
++ Can't you just tell me what it means. I don't have telenet access so i
++ can't get the manual. And it does not say it the perl book that i have.
You don't need any telnet access to get the manual. If you have perl
you *have* the manual.
And if it doesn't say it in the perl book you have, consider buying
Programming Perl, 2nd edition.
And please don't quote sigs.
Abigail
--
perl -we '$_ = "4a75737420616e6f74686572205065726c204861636b65720as";
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
------------------------------
Date: Sun, 29 Mar 1998 02:23:00 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: What does this one liner do?
Message-Id: <ebohlmanEqK6MD.HG1@netcom.com>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
: On Sat, 28 Mar 1998, Mike wrote:
: > Ronald J Kimball wrote:
: (quotes entire posting including sig, so that we shall know what
: conclusions to draw, and then says, inter alia)
: > it does not say it the perl book that i have.
: Book? If you've got a perl distribution, you've got the documentation.
: If you haven't, then how you gonna execute the thing anyway?
: perldoc perlfunc has an entry for select. Isn't it clear?
Based on his previous comment about not having telenet[sic] access, I
suspect that the only Perl distribution he deals with is the one on his
Web presence provider.
Ronald, if you're reading this, you need to find and download the latest
Perl distribution from <URL:http://www.perl.com> and at least install the
documentation on your own system. If that's somehow beyond you, or if you
vastly prefer being online when you get your questions answered, you can
read the documentation online from the same site.
Part of becoming a programmer is learning how to find documentation.
Doing this for Perl is *much* easier (and cheaper) than doing it for most
programming languages. Note that when I say "a programmer" I'm not
talking about a particular job title; I'm talking about someone who can
competently write instructions that tell computers what to do. To do
this, you have to build certain mental models about how computers work;
you can't just think in terms of "what do I type to make this happen?"
The situation where Perl's authors spend lots of unpaid time creating a
comprehensive set of documentation that's the near-equivalent of a college
course in Perl, and then wannabe Perl programmers refuse to look at it and
instead get on Usenet and ask other people to read the manual to them,
reminds me of the old joke about the last man on a sinking ship. There's
space left in one of the lifeboats, but he declines it, saying "no, I know
the Lord will save me." The ship goes down further, and a rescue boat
comes by. Once again he says, "no, I have faith that the Lord will save
me." Later on, a helicopter comes by and drops a ladder. You can guess
how he reacts. Finally the ship sinks completely and he drowns and finds
himself before the Pearly Gates (Perly Gates? Sounds like either a
certain CEO announcing the release of Microsoft Visual P++ 1.0, or a good
name for a drag queen). He asks "Lord, I prayed for you to save me, why
didn't you?" God answers "I sent you a lifeboat, a rescue boat and a
helicopter! What more did you expect me to do?"
------------------------------
Date: 28 Mar 1998 21:02:46 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: What does this one liner do?
Message-Id: <6fkdkm$e8j@tekka.wwa.com>
rootbeer@teleport.com writes:
>On Sat, 28 Mar 1998, Mike wrote:
>
>> What does this do? select(undef,undef,undef,0.1);
>
>What would you like to know that isn't in the docs?
What the select(2) system call does. What does it *mean* when you say
any of the bitmasks can be undef. Is sleeping for 0.1 seconds the ONLY
effect of the call.
Also, what's come over the group.
The answer to the question is: the program pauses for 100 milliseconds.
------------------------------
Date: Sat, 28 Mar 1998 23:58:56 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: what is wrong with being a novice ??
Message-Id: <lassehp-2803982358560001@ygdrasil.imv.aau.dk>
In article <1d6lnww.42wble1qtooqpN@roxboro0-058.dyn.interpath.net>,
phenix@interpath.com (John Moreno) wrote:
>The mac does come with pod2* (pod2text, pod2html, pod2latex, pod2man).
>It doesn't have perldoc, but Shuck works for viewing and navigating
>around the various faqs.
I find it slightly odd that the lack of perldoc on the Mac (and I don't
know if it is present under MPW) should be held against MacPerl or the Mac
in any way.
IMO, Shuck is superior to perldoc in several ways: nicer looking text than
I get on a vt100 window with perldoc, and better lookup facilities. I very
often use Shuck to look up stuff even when I'm programming on Unix. (I do
use perldoc for modules that I have installed on my server, but not on the
Mac.)
One thing I find strange is that perldoc -f <function> gives raw pod as
output. And although I can pipe it through pod2text, I cannot pipe it
through pod2man.
-Lasse
------------------------------
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 2202
**************************************