in reply to split giving me a splitting headache
Or do, :P
sub split_it_this_a_way { my $string = shift || die "die, die, kill you all!"; my ( $second, $first ) = split '\.', reverse($string), 2; ( ~~reverse($first), $second ); } my $str = "x.z.y"; print $str, " -> ", join(" + ", split_it_this_a_way($str)), $/;
...because that's, uh, easier... uh, to, uh...
|
|---|