diff --git a/lib/Genealogy/ObituaryDailyTimes.pm b/lib/Genealogy/ObituaryDailyTimes.pm index afbca9c..ebfde81 100644 --- a/lib/Genealogy/ObituaryDailyTimes.pm +++ b/lib/Genealogy/ObituaryDailyTimes.pm @@ -53,14 +53,15 @@ sub new { return bless { %{$class}, %args }, ref($class); } - if(!defined((my $directory = ($args{'directory'} || $Database::Abstraction->{'directory'})))) { + my $directory = $args{'directory'} || $Database::Abstraction->{'directory'}; + if(!defined($directory)) { # If the directory argument isn't given, see if we can find the data - $directory ||= Module::Info->new_from_loaded(__PACKAGE__)->file(); + $directory = Module::Info->new_from_loaded(__PACKAGE__)->file(); $directory =~ s/\.pm$//; $args{'directory'} = File::Spec->catfile($directory, 'data'); } - if(!-d $args{'directory'}) { - Carp::carp(__PACKAGE__, ': ', $args{'directory'}, ' is not a directory'); + if(!-d $directory) { + Carp::carp(__PACKAGE__, ": $directory is not a directory"); return; }