my %hash = map {$_ => sub {return "

$_

"} } (1..5); $_ = 'foo'; print &{$hash{2}};