use Benchmark qw( cmpthese ); # From "man perlrun": my @array = qw( Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). ); my %tests = ( 'join' => sub { my $str = join('', @array); 1; } , 'stringify' => sub { local $" = ''; my $str = "@array"; 1; } ); print(@array . " words:\n\n"); cmpthese(-2, \%tests); print("\n\n"); splice(@array, 20); print(@array . " words:\n\n"); cmpthese(-2, \%tests); print("\n\n"); @array = (@array) x 100; print(@array . " words:\n\n"); cmpthese(-2, \%tests);