use strict; # direct call of unbound non recursive anonymous subroutine my $res = (sub{ print @_[0] + @_[1] . "\n\n";})->(100,1); # need to bind to a coderef if recursive ? { my $coderef; ($coderef = sub {return unless $_[0] > 0; print "$_[0]\n"; $coderef->($_[0]-1)})->(4); }