in reply to Re: Re: Parse out the extension of a filename - return base of filename.
in thread Parse out the extension of a filename - return base of filename.

It would seem that many have felt I have done something wrong here?

Not necessarily wrong, just another way to do it ... :-)

There are a couple of points that I would highlight with your code:

One aspect about your code however that did seem redundant given that the functionality which you are seeking is available within File::Basename (see my node here for a code example that gives you exactly what you desire from the fileparse method).

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'