in reply to Pass conditions to a subroutine

An anonymous subroutine would work here:
my $cond = sub { !-d $_[0] }; perform_check($cond); sub perform_check { my $cond = shift; ... if ($cond->($possible_directory)) { doSomethingElse(); } }