in reply to Pass conditions to a subroutine
my $cond = sub { !-d $_[0] }; perform_check($cond); sub perform_check { my $cond = shift; ... if ($cond->($possible_directory)) { doSomethingElse(); } } [download]