-1 will return the value of last index.my $str="1:2:3"; my $name=(split(':',$str))[-1];
In reply to Re^3: Splitting on a pattern once
by kiruthika.bkite
in thread Splitting on a pattern once
by perlpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |