in reply to Code review for magazine article?
is equivalent to this:sub wanted { print OUT "$File::Find::dir/"; print OUT "$_\n"; }
...and the second is technically more correct unless you're sure your code is running on an O/S where the path separator is a '/'. Though if it's just a demo you might want to show more of what's available:sub wanted { print OUT "$File::Find::name\n"; }
sub wanted { print OUT "Directory: $File::Find::dir\n"; print OUT "Basename: $_\n"; print OUT "Full Path: $File::Find::name\n"; }
|
|---|