in reply to
Getting a base name
You should use
$base = (split(/\./,$fname))[0];
and better solution is
File::Basename
Comment on
Re: Getting a base name
Download
Code
Replies are listed 'Best First'.
Re^2: Getting a base name
by
reasonablekeith
(Deacon)
on Jul 20, 2005 at 08:48 UTC
It’s not immediately apparent how you would use it though (File::Basename).
See
Re: Parse out the extension of a filename - return base of filename.
for an example which copes with no dots and multiples dots in a file name (something which none of these examples do)
---
my name's not Keith, and I'm not reasonable.
[reply]
In Section
Seekers of Perl Wisdom