what I would probably have done is to first split the string on a comma, then pop the last entry off the resulting array.
As in:
my @array = split /,/, $string; my $value = pop @array;
But you don't really need an array to do that because you can get the last value directly from the list that split returns:
my $value = ( split /,/, $string )[ -1 ];
In reply to Re^2: difference in regex
by jwkrahn
in thread difference in regex
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |