Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: desire to pass file handles by value

by nevyn (Monk)
on Nov 07, 2003 at 09:11 UTC ( #305254=note: print w/replies, xml ) Need Help??


in reply to Re: desire to pass file handles by value
in thread desire to pass file handles by value

Update: Ok, I just learned that you can duplicate a file handle in Perl with open NEW, "<&OLD";. I quickly came up with the following code -

From a Linux man page...

After successful return of dup or dup2, the old and new descriptors may be used interchangeably. They share locks, file position pointers and flags; for example, if the file position is modified by using lseek on one of the descriptors, the position is also changed for the other.
--
James Antill
  • Comment on Re: Re: desire to pass file handles by value

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2019-06-24 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (99 votes). Check out past polls.

    Notices?