fionbarr has asked for the wisdom of the Perl Monks concerning the following question:
but it looks a lot cooler to do this:while (<$infile>) { chomp; $lines[$line_count] = $_; $line_count++; } close $infile;
besides the 'cool' factor, any issues?my @lines = map{chomp;$_;$line_count++;} <$infile>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reading lines into an array
by davido (Cardinal) on Jun 10, 2013 at 20:00 UTC | |
by fionbarr (Friar) on Jun 10, 2013 at 20:12 UTC | |
|
Re: reading lines into an array
by BrowserUk (Patriarch) on Jun 11, 2013 at 03:42 UTC | |
by fionbarr (Friar) on Jun 11, 2013 at 12:29 UTC | |
|
Re: reading lines into an array
by vinoth.ree (Monsignor) on Jun 11, 2013 at 03:24 UTC |