Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Naming file handles with variables?

by vinoth.ree (Monsignor)
on Apr 30, 2009 at 04:34 UTC ( [id://761036]=note: print w/replies, xml ) Need Help??


in reply to Re: Naming file handles with variables?
in thread Naming file handles with variables?

If I use,

while ($line1 = <FILE1> || $line2 = <FILE2> || $line3 = <FILE3>) { #do stuff with each line }

It says, Can't modify logical or (||) in scalar assignment at pl7.pl line 28, near "<FILE3>) " Execution of pl7.pl aborted due to compilation errors.

We have to use 'or'

Vinoth,G

Replies are listed 'Best First'.
Re^3: Naming file handles with variables?
by whakka (Hermit) on Apr 30, 2009 at 04:38 UTC
    You can also wrap the assignment in parentheses, but I qualified my statement with "logically" to address what the code was conceptually doing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-23 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found