From 945f88f45ec50489b41ba2d044345aecca229765 Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Sat, 9 Mar 2013 21:24:54 +0100 Subject: [PATCH] M: Simplified sanity check. --- lib/File/DirWalk.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/File/DirWalk.pm b/lib/File/DirWalk.pm index b766295..5c53e89 100644 --- a/lib/File/DirWalk.pm +++ b/lib/File/DirWalk.pm @@ -46,7 +46,7 @@ sub new { sub setHandler { my ($self,$action,$func) = @_; - if ($action !~ /onBeginWalk|onLink|onFile|onDirEnter|onDirLeave/) { + if (not exists $self->{$action}) { croak("Invalid action argument: $action"); }