Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: put file content into a string

by Hue-Bond (Priest)
on Dec 19, 2005 at 16:19 UTC ( [id://517781]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
      local $/ = undef;
      open my $fd, '<', 'file' or die "open: $!";
      my $txt = <$fd>;
      close $fd;
    }
    
  2. or download this
    open my $fd, '<', '/home/hue/f1' or die "open: $!";
    my $txt = join '', <$fd>;
    close $fd;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found