#!/usr/bin/perl use Benchmark qw(:all :hireswallclock); use strict; use warnings; my $hash = {}; my $count = 100000; timethese($count, { 'new' => '$hash = undef; $hash = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}', 'clear' => '%$hash = (); %$hash = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)', });