#!/usr/bin/perl use strict; use warnings; use Benchmark qw[ timethese :hireswallclock]; sub with_my { while () { my @array = split; } } my @array2; sub without_my { while () { @array2 = split; } } for (1 ..5) { timethese (5000000, { with_my => 'with_my()', without_my => 'without_my()' }); } __DATA__ The quick brown fox jumps over the lazy dog.