in reply to Re^2: Splitting on a pattern once
in thread Splitting on a pattern once
Use the following way to achieve your requirement.
-1 will return the value of last index.my $str="1:2:3"; my $name=(split(':',$str))[-1];
|
---|
In Section
Seekers of Perl Wisdom