in reply to Re^2: Removing dots
in thread Removing dots
You can get your answer more quickly by firing up the debugger and just trying it out:
And faster still (in the long run) if you just study perlre.% perl -de 1 DB<1> $s = 'Hello.1.txt' DB<2> $s =~ s/\.(?=txt$)//g # in this case the /g is superfluous DB<3> p $s Hello.1txt
the lowliest monk
|
|---|