use v5.10; use strict; use warnings; use Benchmark qw( cmpthese ); sub Foo::bar { $_[0][0] or die } our $object = bless [1], "Foo"; cmpthese -1 => { "method call" => q[ $::object->bar ], "fun call" => q[ Foo::bar( $::object ) ], }; __END__ Rate method call fun call method call 4365983/s -- -15% fun call 5128108/s 17% -- #### sub Foo::bar { my $filename = sprintf('/tmp/%s.txt', ref $_[0]); open my $fh, '>', $filename or die($!); print $fh $_[0][0] or die($!); close $fh or die($!); 1 while unlink $filename; }