Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a filename and I want to remove the file extension so that only remains. Note, the file extension might not always be .txt.

I've tried s/\..*/ but that removes everything after the first period and I'm left with only foo for my filename.

Thank you. Any help you could provide would be greatly appreciated.