in reply to Re(3): Regex Capturing: Is this a bug or a feature?
in thread Regex Capturing: Is this a bug or a feature?

I believe you're correct. I tried to verify my recollection and came up with something even stranger.
#!/usr/bin/perl # 5.6.1 use strict; use warnings; my @values = qw ( one var.1 test); getsymbolval(@values); ################################################# sub getsymbolval{ my @syms = @_; foreach my $symbol (@syms){ $symbol=~m/(\w+)(\.)?(\d+)/; print "symbol: $symbol\t\$1: $1\t\$2:$2\n"; my ($ts,$te) = ($1,$2); } wantarray ? @syms : $syms[0]; } __END__

Output follows (minus uninitilized warnings): What's up with just 'v' being in the regex?
symbol: one $1: $2:
symbol: var.1 $1: var $2:.
symbol: test $1: v $2:
Very odd.

-Lee

"To be civilized is to deny one's nature."