Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to make a copy of filehandle

by LanX (Canon)
on Apr 09, 2013 at 08:19 UTC ( #1027672=note: print w/ replies, xml ) Need Help??


in reply to How to make a copy of filehandle

Are you looking for tell and seek ?

They help getting and setting the "pointer" of a filehandle.

Cheers Rolf

( addicted to the Perl Programming Language)

PS: regarding your code

>   open ($hdl_sauv, "<",$file) || die "cannot open $file\n";

are you aware that $file is a filehandle and not a path?

EDIT:

If you wanna dup a filehandle you need something like "<&" as MODE. See open for details.

Though don't think this handles position the way you want to.


Comment on Re: How to make a copy of filehandle
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-05 22:27 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 (68 votes), past polls