On 2007/01/23, at 11:03, Rob Dixon wrote:

$file =~ s/(.*)\./$1/;

or

$file =~ s/\.[^.]*$//;


If you know the suffix of the files you're working on, you can use the File::Basename module, more specific the fileparse function:

use File::Basename;

my @suffix = qw(.txt .zip .doc);
my $filepath = "/tmp/something.txt";
my ($name, $path, $suffix) = fileparse($filepath, @suffix);

HTH!

--
Igor Sutton
[EMAIL PROTECTED]



Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to