[32906] in Perl-Users-Digest
Perl-Users Digest, Issue: 4184 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 1 18:09:23 2014
Date: Tue, 1 Apr 2014 15:09:02 -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 Tue, 1 Apr 2014 Volume: 11 Number: 4184
Today's topics:
read and parse a single line file <rweikusat@mobileactivedefense.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 01 Apr 2014 22:34:23 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: read and parse a single line file
Message-Id: <87a9c4n38g.fsf@sable.mobileactivedefense.com>
Right now, I'm dealing with (two) single line files whose single line
contains data in the form of
YYYYMMDD XXXX
the first being a date and the second a counter. So far, I've been using
a pretty conventional
$rc = <$fh>;
chomp($rc);
($date, $counter) = split(/\s+/, $rc);
for getting the data out of the file. While working with this code in
order to add some features to it, it came to me that
($date, $counter) = split for <$fh>
works as well, as does
($date, $counter) = map { split } <$fh>;
but I like the first one better. Comments or alternate suggestions?
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 4184
***************************************