in reply to Re: simple regexp problem
in thread simple regexp problem

I think you have to add a limit parameter to split here, to not lose additional "underscore delimited fields"

D:\temp>perl -e "$x='a_b_c'; ($j, $k) = split /_/, $x; print $k" b D:\temp>perl -e "$x='a_b_c'; ($j, $k) = split /_/, $x, 2; print $k" b_c

Replies are listed 'Best First'.
Re^3: simple regexp problem
by davidrw (Prior) on Dec 05, 2005 at 18:21 UTC
    true, but is totally dependent upon OP's requirements .. should "a_b_c" result in part1=a, part2=b and c getting lost, or should "a_b_c" result in part1=a and part2=b_c ?