in reply to Re^2: using basename on a list of filesnames
in thread using basename on a list of filesnames
Did you add a debug print statement inside the loop to see what you are passing to basename() in $file? It really works:
... but passing an undefined value does not:$ perl -MFile::Basename -wE 'say basename("foo.psd",".psd")' foo
$ perl -MFile::Basename -wE 'say basename(undef,".psd")' Use of uninitialized value $_[0] in substitution (s///) at /Users/1nic +kt/perl5/perlbrew/perls/perl-5.30.0/lib/5.30.0/File/Basename.pm line +341. fileparse(): need a valid pathname at -e line 1.
|
|---|