my($foo, $bar) = (1,2); my @vars = \($foo, $bar); # note the backslash before the list # this would do the same: my @vars = (\$foo, \$bar); foreach my $var (@vars) { $$var += 4; # note the de-referencing $ before $var } print "\@vars: @vars\n"; print "\$foo: $foo\n"; print "\$bar: $bar\n"; __END__ @vars: SCALAR(0x15ae7a0) SCALAR(0x15ae830) $foo: 5 $bar: 6