I'm not sure what you are saying but if you are just looking to do this on one scalar variable, get rid of the loop and replace $file with your variable:
print ((split /\./, $your_variable)[-1] . "\n") ;
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Re^3: How to remove the words before the dot using perl?
by nysus
in thread How to remove the words before the dot using perl?
by finddata
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |