Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: globbing filehandles in arrays

by almut (Canon)
on Jan 23, 2009 at 13:44 UTC ( [id://738483]=note: print w/replies, xml ) Need Help??


in reply to globbing filehandles in arrays

while(my $line=<$FH[$i]>){

<$FH[$i]> doesn't work for syntactic reasons, i.e. special parsing rules apply for <...>, and only simple expressions like <$fh> can be handled.

Use readline $FH[$i] instead, if you don't want to use an intermediate variable.

Update: also note that whitespace isn't allowed either, i.e. < $fh > and <$ fh> won't work... it has to be exactly <$fh>.

Replies are listed 'Best First'.
Re^2: globbing filehandles in arrays
by why_bird (Pilgrim) on Jan 26, 2009 at 08:38 UTC

    Ah, I didn't know that (either about readline or about special parsing rules for <...>).

    Thanks!
    why_bird
    ........
    Those are my principles. If you don't like them I have others.
    -- Groucho Marx
    .......

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 16:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found