sub test (&){ my $print = shift; say "You are in the method"; $print->(1); say "You are again back to the method"; $print->(2); } test { say "You are in the block $_[0]" };