Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

RE: Load file into a scalar without File::Slurp

by audreyt (Hermit)
on Jul 25, 2000 at 01:25 UTC ( #24191=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $contents=slurp('foobar');
    sub slurp {local$/=<>if local@ARGV=@_}
    
  2. or download this
     
    {local$/;$contents=<>if local@ARGV='foobar'};
    
  3. or download this
     
    $contents=join'',<_>if open _,'foobar';
    
  4. or download this
    $contents=`cat foobar`
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-07-08 00:13 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 (93 votes), past polls