my $condition = sub { !-d $_[0] }; my $result = check( $condition ); sub check { my ($condition) = @_; # Obviously, you'll need to find $param from somewhere. if ( $condition->( $param ) ) { blah(); } }
In reply to Re: Pass conditions to a subroutine
by dragonchild
in thread Pass conditions to a subroutine
by PerlRob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |