http://www.perlmonks.org?node_id=978427


in reply to Style - how to give class method call as parameter

Personally, I like number three best, but as an alternative, you can wrap number three in some syntactic sugar:

sub transaction(&$$) { my ($cb, $self,$timeout) = @_; $self->do_sub_with_timeout( $cb, $timeout ); }; transaction { $deployer->extend_order_lease( $order, $end_date ); } $self, $timeout;

Unfortunately, the & prototype must come as the first argument. I'm also not convinced that this style is less confusing/more readable than the other.