in reply to Re: Passing a variable to a hash
in thread Passing a variable to a hash

Just wanted to point out that the OP can achieve this by using references (which are probably above his head right now and far from ideal for this exact problem, but just trying to be complete):

my %vlan = ( "VLAN1" => \$vl1 ); # ... while (($key, $value) = each %vlan) { # note the dereferencing ${$var} # can be shortened to $$value print "Now checking: ${system}_$key ${$value}"; }

Oh, and it is preferred to delimit variables with "${var}" when interpolating. (This is not related to dereferencing.)