Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Any downsides to this slurp idiom?

by Eily (Monsignor)
on Jun 22, 2018 at 12:54 UTC ( [id://1217187]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open $fh, '<', $file or die $!; 
    process($fh) if is_valid($fh);
    
  2. or download this
    die $! unless open $fh, '<', $file; 
    is_valid($fh) and process($fh);
    
  3. or download this
    my $data;
    {
      local $/;
      open my $fh, '<', $file or die $!;
      $data = <$fh>;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found