http://www.perlmonks.org?node_id=1029815
tobias_hofer has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks!

Following is making me crazy, I just want to delete the substring ".xml" from "..\MyXMLFile.xml" by a trim:

my $FileName = "..\\MyXMLFile.xml"; $FileName =~tr/(\.xml)$//d;

But my string is getting to this: "\MyXMLFile" the leading dots are missing. How comes?

When I do it this way - with a search - it works fine..:
my $FileName = "..\\MyXMLFile.xml"; $FileName =~s/(\.xml)$//i;

Why?

Any hints are highly welcome!
Best regards! Tobias