my $str="1 2 3 4 590"; my ($a,$b)=split(/ ([^ ]+)$/, $str); print "a=$a\nb=$b\n";
my $str="1:2:3:4:590"; my ($a,$b)=split(/:([^:]+)$/, $str); print "a=$a\nb=$b\n";
In reply to Re^3: Splitting on a pattern once
by kiruthika.bkite
in thread Splitting on a pattern once
by perlpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |