This is a newbie question, but what is the special variable, @-? For example, this code:
sub rightmost{ my($string, @patterns) = @_; my $rightmost = -1; while( my($i, $pattern ) each @patterns ) { $position = $string =~ m/$pattern/ ? $-[0] : -1; $rightmost = $position if $position > $rightmost; }
In reply to Special Variables by carlriz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |