Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: perldoc -f fileno

by imp (Priest)
on May 24, 2007 at 03:58 UTC ( #617160=note: print w/ replies, xml ) Need Help??


in reply to perldoc -f fileno

You can open a filehandle that uses a scalar reference as the data source, like this:

use strict; use warnings; my $data = "a\nb\n"; open my $fh, '<', \$data; my $fileno = fileno $fh; printf "fileno: %s\n", defined $fileno ? $fileno : '(undef)'; print for <$fh>; close $fh; $fileno = fileno $fh; printf "fileno: %s\n", defined $fileno ? $fileno : '(undef)';


Comment on Re: perldoc -f fileno
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://617160]
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: (3)
As of 2015-07-05 09:29 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 (61 votes), past polls