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


I have a text file containing different file names ex :






I want to remove the patterns appearing after the decimal numbers. So my output text file should have






I have tried the following code, but doesnt seem to work. Can anyone help me with shortest code to do this inside a perl subroutine? Pardon my beginner level question at perl coding.

if($line=~ /^\/fd\/gfree\/tere\/frf4545\/geerg\/(.*)\/(.*)\/fsdf\/(.*) +\//){ + + $line=~ s/\/fsdf\(.*)\///g; + }