Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

RE: Answer: I need an array of filehandles.

by Anonymous Monk
on Apr 25, 2000 at 15:43 UTC ( [id://8939]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I create an array of filehandles?
in thread How can I create an array of filehandles?

You don't need a function do this. You can just:
open( FILE, "< $file" ) or die( "Bad things happened : $!" ); my $fh = \*FILE; # # Now use $fh as you see fit... # print $fh "Hello, world\n"; # Shouldn't work...FILE was opened RDONLY + :-) $line = <$fh>; do_stuff( $fh ); sub do_stuff { my $fh = shift; print $fh "Whatever...\n"; }
Hope this helps

Log In?
Username:
Password:

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

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

    No recent polls found