Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

How can you sysread an entire file?

by NeilF (Sexton)
on Jan 12, 2006 at 19:51 UTC ( #522791=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my $rec;
        sysopen(DF, "test.txt", O_RDONLY);
        sysread DF, $rec, 26214400;    #25meg
        close DF;
    
  2. or download this
        foreach(split("\n",$rec)){push(@array,"$_\n";)}
        $rec='';    # Release memory
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2015-07-30 15:20 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 (272 votes), past polls