Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: using basename on a list of filesnames

by 1nickt (Canon)
on Nov 13, 2019 at 05:03 UTC ( [id://11108612]=note: print w/replies, xml ) Need Help??


in reply to Re: using basename on a list of filesnames
in thread using basename on a list of filesnames

How is it correct usage to pass a list of filenames?! Only the first is handled as a filename; the rest are possible suffix matches.

From the doc:

$basename = basename($fullname,@suffixlist);

$ perl -MFile::Basename -wE 'say basename("foo.psd","bar.psd",".psd")' foo


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: using basename on a list of filesnames
by jcb (Parson) on Nov 14, 2019 at 00:35 UTC

    You are right. I had misread the code because passing the entire list a loop is iterating over instead of the current item is not a mistake I have ever made.

    The change I suggested is still needed, since our questioner is currently iterating over a list, but only passing a single value to his output routine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found