#!/usr/bin/perl use strict; use Devel::OpProf qw(profile print_stats zero_stats ); profile(1); # turn on profiling my $now = 8; # we'll pretend it's between 8 and 9 PM my %url = ( monday => { @{[map(($_,1), (1..1000))]} } ); #start profiling zero_stats; $now = (sort grep {$_ <= $now} keys %{$url{'monday'}})[-1]; print_stats; zero_stats; $now = ($now < $_ && $_ < 8 ? $_ : $now) for keys %{$url{'monday'}}; print_stats;