my %hash = ( 1 => One, 2 => Two, 3 => Three); my $var = 2; print "$hash{$var}\n";