in reply to Re: difference in regex
in thread difference in regex

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 ];

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.