# example snippet. Doesn't refer to a real function yet... my $result = timeout ( time =>1.5, sub =>sub { # do something complicated here # that may take a long time return $whatever; }, timed_out => "Function timed out" );