print "$match[1] was val for $match[0]\n"; my ($key,$val) = (0,1); print "$match[$val] was val for $match[$key]\n";