Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Reading files n lines a time

by naturalsciences (Beadle)
on Dec 06, 2012 at 14:12 UTC ( #1007582=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Reading files n lines a time
in thread Reading files n lines a time

More on the undefined variables problem. Would adding something like this do a loop be correct.

while ($line0=<>) {$line1=<>;$line2=<>;$line3=<>; last if not defined $line0; last if not defined $line1; last if not defined $line2; last if not defined $line3; do_some_stuff; }

Could I use some OR statements to get these last if-s on a single line. Or can or and and statements used only between two values. I was thinking like

 last if not defined $line0or$line1or$line2or$line3

or

 last if not defined $line0||$line1||$line2||$line3


Comment on Re^3: Reading files n lines a time
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-10-24 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls