#!/opt/perl_5.8.7/bin/perl use Benchmark qw(:all); my $path = "test.lnk"; my $coderef = sub { if (-e $path) { if (-l $path){ print "path is link \n"; } elsif (-d _) { print "Path is directory \n"; } elsif (-f _) { print "Path is file \n"; } } }; my $coderef1 = sub { if (-e $path) { if (-l $path){ print "path is link \n"; } elsif (-d $path) { print "Path is directory \n"; } elsif (-f $path) { print "Path is file \n"; } } }; my $r = cmpthese( 50000000, { statreuse => $coderef->(), nostatreuse => $coderef1->() });