Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 examining the Monastery: (8)
As of 2015-07-06 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls