#!/usr/bin/perl # 5.6.1 use strict; use warnings; use vars qw ($test); my @values = qw ( one var.1 test); print join ("\t->\t",getsymbolval(@values) ),"\n"; ################################################# sub getsymbolval{ no strict qw (refs); my @syms = @_; foreach my $symbol (@syms){ local $test; ############################## # Bug? # ############################## $symbol=~m/(\w+)\.(\d+)/; # Shouldn't $1,$2... get reset each time through? print "symbol: $symbol\t\$1: $1\t\$2:$2\n"; print "test is ",$test++,"\n"; # Never incremented more than once my ($ts,$te) = ($1,$2); } wantarray ? @syms : $syms[0]; }