in reply to Dynamic execution of expression
my %hash; my $condition = sub { ! exists $hash{key} }; # and later on use it as if ($condition->()) { print "'key' does not exists in \%hash\n"; } [download]