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
In reply to Re^3: Removing dots
by tlm
in thread Removing dots
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |