Try this
s/(.*)\..*/\1/;

Thanks,
Shaick.

On 1/23/07, Saravana Kumar <[EMAIL PROTECTED]> wrote:
Hi list,

I am trying to remove the extension from the a list of filenames and
manipulate the names further.

Tried to doing this:
$file=~ s/\..*//;

The above works fine. I get the result 'filename' if the filename is
filename.ext.

There are some files whose names are like file.name.ext and the result i get
for this is 'file' while the desired result is 'file.name'. Is there a way
to fix this?

TIA,
SK


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to