I think I would rather explicitly extract whatever it was I was interested in rather than relying on a somewhat obscure feature of the split built-in:
c:\@Work\Perl\monks>perl -wMstrict -le
"$_ = qq{xxx ekey=foo bar \n xyzzy};
;;
my (undef, $captured) = split(/ekey=(.+)/, $_);
print qq{captured '$captured'};
;;
my ($bagged) = $_ =~ m{ ekey= ([^\n]+) }xms;
print qq{ bagged '$bagged'};
"
captured 'foo bar '
bagged 'foo bar '
Give a man a fish: <%-(-(-(-<
|