use strict; use warnings; use v5.12; my ( $a, $b, $c, $d ); my %hash = ( 'a' => 'apple', 'b' => 'banana', 'c' => 'cantaloupe', 'd' => 'dice', ); my $n = 1; foreach my $symbol ( keys %hash ) { say "Iteration ", $n++, ": $symbol => $hash{$symbol}"; say "\tExecuting as follows: \$$symbol = \$hash{\$symbol}\n"; eval "\$$symbol = \$hash{\$symbol}"; # <--------- The evil. } foreach my $symbol ( qw/a b c d/ ) { say "\$$symbol now contains ", eval "\$$symbol"; # Once we start the evil it's hard to stop. }