in reply to Pass conditions to a subroutine

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(); } }

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?