Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Distinguishing a filehandle for an in-memory string

by roboticus (Chancellor)
on May 18, 2018 at 01:26 UTC ( [id://1214806]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub is_FH_a_wrapped_scalar {
        my $FH = shift;
        return grep { $_ eq "scalar} } PerlIO::get_layers($FH);
    }
    
  2. or download this
    $ perl pm_1214805.pl
    FH is a wrapped scalar, do something else!
    ...
    open $fh, "<", \"/etc/passwd" or die; doit_read $fh;
    open $fh, "<",  "/etc/passwd" or die; doit_sysread $fh;
    open $fh, "<",  "/etc/passwd" or die; doit_read $fh;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found