# code not tested use strict; use warnings; my %called; my $interval = 60; # how long before they can call it again sub something { my $user = shift; # pass the function the name of the user calling it my $now = time; return if exists $called{$user} and $now < $called{$user} + $interval; $called{user} = $now; # do the costly funtion }