View Single Post
Old Mar 24th, 2005, 9:20 AM   #3
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
You could slurp and split the file, too; to get a list of the lines in a file, you could do:

local $/;
my @lines = split("\n", <IN>);

That 'local $/;' line makes $/, the input record separator, locally undefined so you can 'slurp' the whole file rather than a line at a time.
mackenga is offline   Reply With Quote