use Benchmark; use Symbol; my $fh = gensym; open $fh, ">/dev/null" or die $!; my($one, $two, $three) = map { $_ x 4096 } 'a'..'c'; timethese(100_000, { ref_array => sub { my @a; push @a, \($one, $two, $three); my_print(@a); }, array => sub { my @a; push @a, $one, $two, $three; my_print(@a); }, concat => sub { my $s; $s .= $one; $s .= $two; $s .= $three; my_print($s); }, }); sub my_print { for (@_) { print $fh ref($_) ? $$_ : $_; } }