my %hash; my $condition = sub { ! exists $hash{key} }; # and later on use it as if ($condition->()) { print "'key' does not exists in \%hash\n"; }
In reply to Re: Dynamic execution of expression
by moritz
in thread Dynamic execution of expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |