in reply to Splitting multiline scalars into different array entries
If you want to update the original data just change the my @results = to @AoA =. Also you could use Scalar::Util::first there instead of grep if you're looking for an optimal solution.use Data::Dumper; ## your @AoA here ... my @results = map { grep(/\n/, @$_) ? map([split "\n"], @$_) : $_ } @AoA; print Dumper( \@results );
HTH
_________
broquaint
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Splitting multiline scalars into different array entries
by davis (Vicar) on Aug 05, 2005 at 11:15 UTC | |
by broquaint (Abbot) on Aug 05, 2005 at 11:23 UTC | |
by davis (Vicar) on Aug 05, 2005 at 11:29 UTC | |
by Anonymous Monk on May 15, 2012 at 05:40 UTC |
In Section
Seekers of Perl Wisdom