in reply to Re^2: RFC: Simulating Ruby's "yield" and "blocks" in Perl
in thread RFC: Simulating Ruby's "yield" and "blocks" in Perl
FWIW, the equivalent in idiomatic Python3 is:
As for anonymous multiline blocks, a while back a monstrosity was released...def test() print("You are in the method") yield 1 print("You are again back to the method") yield 2 for a in test(): print("You are in the block #{}".format(a))
In Section
Meditations