in reply to Transforming a scalar to an array
I realize that local( $/, *INPUT ); gets rid of the new lines.
It doesn't actually. You end up with a scalar that still has a newline at the end of each line of text. You can, of course, use that to your advantage.
my @lines = split /\n/, $input;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Transforming a scalar to an array
by ikegami (Patriarch) on Jul 15, 2009 at 15:19 UTC |
In Section
Seekers of Perl Wisdom