in reply to Making an array out of each line in a file
open FILE, '<', $filename or die "Can't open $filename: $!\n"; my @lines = <FILE>; close FILE or die "Can't close $filename: $!\n";
will fill @lines. See also the $/ variable.
--
Yours in pedantry,
F
o
x
t
r
o
t
U
n
i
f
o
r
m
"Anything you put in comments is not tested and easily goes out of date." -- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
close or die
by PerlingTheUK (Hermit) on Nov 11, 2004 at 22:34 UTC | |
by FoxtrotUniform (Prior) on Nov 11, 2004 at 22:42 UTC | |
by Fletch (Bishop) on Nov 12, 2004 at 00:50 UTC | |
by tilly (Archbishop) on Nov 12, 2004 at 02:34 UTC | |
by PerlingTheUK (Hermit) on Nov 11, 2004 at 23:09 UTC | |
by chb (Deacon) on Nov 12, 2004 at 08:39 UTC |
In Section
Seekers of Perl Wisdom