Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: File handling basics

by vinoth.ree (Monsignor)
on Jul 17, 2015 at 10:39 UTC ( [id://1135145]=note: print w/replies, xml ) Need Help??


in reply to Re^4: File handling basics
in thread File handling basics

Then replace the while loop with this code my @lines = <F>;

open (F, $file) or die "cannot open file"; my @lines = <F>; close F;

you can do the same with perl module File::Slurp

use File::Slurp; my @array = read_file($filename);

All is well. I learn by answering your questions...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found