Hi, I am having troubles with a variable that should not be defined but seems to be somehow. In the following code, the variable $localdir is declared, then I am doing a find, and in case I get a result the returned path is assigned as a value to $localdir. But somehow the latter IF results to TRUE (=$localdir is defined) although the find does not return a path (which is ok for my current test). Please could tell me what I do not understand? I thought this was the proper way to check whether a variable has a value or not (or at least my Perl book says so)!?
*** snip *** my $localdir; if (defined $localdir) { print "defined 1: $localdir\n"; } # undefined = ok for this test my $find = File::Finder->type('d')->name("$sdir")->print; $localdir = find ( $find, "$dbpath/dumps"); if (defined $localdir) { print "defined 2: $localdir\n"; } # DEFINED although no directory :-( *** snip *** Kind regards, Nora