[26486] in Perl-Users-Digest
Perl-Users Digest, Issue: 8648 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 9 11:05:29 2005
Date: Wed, 9 Nov 2005 08:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 9 Nov 2005 Volume: 10 Number: 8648
Today's topics:
[OT] Re: why the perl documents is hard to understand? <1usa@llenroc.ude.invalid>
Re: How to get array item directly from split result? <someone@example.com>
Re: Problems with while loop <john.dimper@nospam.com>
Re: why the perl documents is hard to understand? axel@white-eagle.invalid.uk
Re: why the perl documents is hard to understand? <hlawson@triad.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 09 Nov 2005 13:12:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: [OT] Re: why the perl documents is hard to understand?
Message-Id: <Xns970953781D232asu1cornelledu@127.0.0.1>
axel@white-eagle.invalid.uk wrote in
news:H9mcf.30085$j5.20314@fe1.news.blueyonder.co.uk:
> Xiaoshen Li <xli6@gmu.edu> wrote:
>> I cannot give out specific examples. But believe me, print out a
>> couple of descriptions of functions in Perl and go to talk to some
>> *good* college students major in literature, explain clearly to them
>> what each function does in Perl, and ask them write down the
>> descriptions with similar amount of words. I bet, the "documentation"
>> from them is much better.
>
> Yes... every time I have asked for a definition of 'post-modernism'
> from such people, the reply has been totally uninformative.
ROTFL
http://www.google.com/search?q=define%3A+postmodernism
is telling.
A post-modernist Perl might be fun: There would be no one correct way of
using, say, split. split would do whatever the programmer thought it
would. Just a higher order of DWIM, don't you see? :)
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 09 Nov 2005 11:50:46 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to get array item directly from split result?
Message-Id: <qolcf.191742$ir4.11004@edtnps90>
Huajian Luo wrote:
> Hi there,
>
> I'm now parse a output from a command which need use split to
> split each line to array and get the fields like the following
> pseudo code.
>
> for my $line (@lines) {
> if ($line =~ /mb_setno/) {
> $line =~ s/\s//;
> my @fields = split(/\s+/, $line);
> my $100th_fld = $fields[99];
> }
> }
>
> Cause the fields is too much, I wanna skip the @fields by just
> my $100th_fld = split(/\s+/, $line){99};
That should be:
for my $line ( @lines ) {
if ( $line =~ /mb_setno/ ) {
my $100th_fld = ( split ' ', $line )[ 99 ];
}
}
Or if you want to save some typing:
for ( @lines ) {
if ( /mb_setno/ ) {
my $100th_fld = ( split )[ 99 ];
}
}
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 09 Nov 2005 12:00:47 GMT
From: "John Dimper" <john.dimper@nospam.com>
Subject: Re: Problems with while loop
Message-Id: <Pxlcf.30415$Av1.9834@fe3.news.blueyonder.co.uk>
> This is untrue. Strike your ENTER key a couple of times
> within your command prompt after invoking your script.
>
> While not sending input, your script will sit there doing nothing,
> save for waiting for input.
>
> Appears this is not a Perl issue but rather an operator issue. =)
>
Thanks for you responses... Sinans someprog | perl script.pl did the trick.
For your info it isn't a problem waiting for input - the same happens if I
try C:\type afile.txt | perlscript.pl. Anyway - all sorted now.
Thanks again,
John
------------------------------
Date: Wed, 09 Nov 2005 12:43:19 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: why the perl documents is hard to understand?
Message-Id: <H9mcf.30085$j5.20314@fe1.news.blueyonder.co.uk>
Xiaoshen Li <xli6@gmu.edu> wrote:
> I cannot give out specific examples. But believe me, print out a couple
> of descriptions of functions in Perl and go to talk to some *good*
> college students major in literature, explain clearly to them what each
> function does in Perl, and ask them write down the descriptions with
> similar amount of words. I bet, the "documentation" from them is much
> better.
Yes... every time I have asked for a definition of 'post-modernism'
from such people, the reply has been totally uninformative.
Axel
------------------------------
Date: Wed, 09 Nov 2005 13:57:47 GMT
From: Hugh Lawson <hlawson@triad.rr.com>
Subject: Re: why the perl documents is hard to understand?
Message-Id: <87slu5ylce.fsf@desktop.xx.yy>
Bart Lateur <bart.lateur@pandora.be> writes:
> Like people said: it's a reference manual. Accuracy is more important
> than being easy to read, it's not a tutorial. You're better off starting
> with a tutorial, I recommend "Learning Perl" by Randal Schwartz (AKA the
> Llama -- the book, not the author). Two days with this book, and you'll
> feel more at ease with Perl.
I'm a Perl novice, and I found "Learning Perl" helpful.
The distinction between reference manual and tutorial is also
useful. Bert did a good job pointing to it rather than sermonizing the
baffled OP. Novices often don't know that man pages are not
tutorials. The man pages are usually silent about their place in the
Great Ladder of Knowledge. (I should acknowledge that perl man pages
are more informative about this.)
To novices struggling with a difficult text, the situation seems
frustrating and insulting. The temptation is to blame the text and
its author, rather than one's own limitations.
This being-insulted-by-difficult-text is a normal and natural
feeling. That is why we have popularizations, tutorials,
introductions, teachers, and so on.
OT: For those frustrated by brief explanations of post-modernism, five
or six weeks of hard reading will probably give you some idea of
it. But expect to be confused and frustrated much of the time. You can
enjoy a happy, rich life without bothering with it at all.
--
Hugh Lawson
hlawson@triad.rr.com
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8648
***************************************