perl -e '$choice="1"; %hash=( 0 => one, 1 => two ); sub one {print "one\n"}; sub two {print "two\n"} &{$hash{$choice}}' two