[Pdx-pm] read and concatenate two lines at a time

Randal L. Schwartz merlyn at stonehenge.com
Tue Dec 7 15:44:40 CST 2004


>>>>> "Ken" == Ken Brush <ken at cgi101.com> writes:

Ken> FYI,  You can even reduce it by one more operation by doing:

Ken> while( my $entry = <> . <>)  {
Ken> 	$entry =~ s/\n//g;
Ken> ...

Not safely.  If the first operation returns undef, to indicate the end
of the @ARGV list, the second operation will read a line from STDIN!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


More information about the Pdx-pm-list mailing list