my $predicate = sub { $_[0] =~ /^\d{4}-\d{2}-\d{2}/ }; my $other_result = &checkForDirectory( $predicate );