#!/usr/bin/perl -w use strict; use Benchmark; my $file = $0; open IN, $file or die "$file: $!\n"; sub joinit { my $content = join '', ; } sub dollarslash { my $content = do { local $/; } } timethese(100_000, {join => \&joinit, slash => \&dollarslash} );