Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Building three-dimensional array using push

by zejames (Hermit)
on Dec 02, 2004 at 16:51 UTC ( #411856=note: print w/replies, xml ) Need Help??


in reply to Building three-dimensional array using push

while (<FILE>) { $line = <FILE>; ... } close(FILE);

The <FILE> reads one line of the file each time. So with that code, $line is set with the data of only one line where two are read...

You should use

:
my $line while ($line = <FILE>) { ... } close(FILE);

HTH


--
zejames

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://411856]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-10-20 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (208 votes). Check out past polls.

    Notices?