取り敢えず、ベンチマーク。

$ cat bench.pl
#!/usr/bin/perl
use Benchmark qw( cmpthese timethese ) ;
my $f = +( "42¥r¥n" x 1000 ) . +( "¥r¥n" x 10000 ) ;
sub _gm { my $f2 = $f ; $f2 =~ s/[¥012¥015]$//gm ; }
sub _while { my $f2 = $f ; 1 while $f2 =~ s/[¥012¥015]$// ; }

cmpthese(timethese (undef, {
while => '_while',
gm => '_gm',
})) ;

$ perl bench.pl
Benchmark: running gm, while for at least 3 CPU seconds...
gm: 3 wallclock secs ( 3.36 usr + 0.01 sys = 3.37 CPU) @ 356.68/s (n=1202)
while: 3 wallclock secs ( 3.06 usr + 0.00 sys = 3.06 CPU) @ 152.94/s (n=468)
Rate while gm
while 153/s -- -57%
gm 357/s 133% --