#!/usr/bin/perl use strict; use warnings; use Benchmark qw /cmpthese/; chomp (our @strings = ); cmpthese -5 => { chop => 'my @copy = @strings; foreach my $str (@copy) { chop $str; chop $str; chop $str; chop $str; }', substr3 => 'my @copy = @strings; foreach my $str (@copy) { $str = substr $str => 0, -4; }', substr4 => 'my @copy = @strings; foreach my $str (@copy) { substr $str => -4, 4 => ""; }', }; __DATA__ asdfjas;dfjas;dfjas;dkfjasdfasdf asd sdfajsd;flaks Rate chop substr3 substr4 chop 152166/s -- -11% -14% substr3 170187/s 12% -- -4% substr4 176800/s 16% 4% --