#!/usr/bin/perl use strict; use warnings; use Benchmark qw(:all :hireswallclock) ; cmpthese(20, { 'Backtick' => sub{`echo plenty of fish` for 1 .. 10}, 'Open' => sub{for (1 .. 10){open my $fh, "echo plenty of fish |"; <$fh>}}, });