Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 studying the Monastery: (10)
As of 2014-09-22 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls