#!/usr/bin/perl use strict; use warnings; use Benchmark; my @test= qw(this that what where who how why); my $results = timethese(50000, { 'map' => sub { print map ("$_\n", @test) }, 'printfor' => sub { print "$_\n" for @test; }, 'join' => sub { print join("\n", @test),"\n"; }, 'forprint' => sub { for (@test) {print "$_\n"; } }, 'plain' => sub { print @test; }, #plain is for additional test like abigail 'abigail' => sub { $,=$\=$/; print @test; }, }, 'none' ); Benchmark::cmpthese($results); #### Rate map printfor forprint abigail join plain map 48544/s -- -2% -5% -52% -71% -72% printfor 49505/s 2% -- -3% -51% -70% -71% forprint 51020/s 5% 3% -- -50% -69% -70% abigail 102041/s 110% 106% 100% -- -39% -41% join 166667/s 243% 237% 227% 63% -- -3% plain 172414/s 255% 248% 238% 69% 3% --