# New Ticket Created by Zoffix Znet # Please include the string: [perl #131504] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=131504 >
I assumed the .&foo form was just a nicer way of writing foo($_), however they differ in that the thrown control exception doesn't go far enough in .&foo form and it doesn't actually return from the routine with things like .&fail and .&return <Zoffix__> m: sub { 'foo'.&fail; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «foo in sub at <tmp> line 1 in block <unit> at <tmp> line 1Actually thrown at: in sub at <tmp> line 1 in block <unit> at <tmp> line 1» <Zoffix__> m: sub { fail 'foo'; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Failure» <Zoffix__> m: sub { return 'foo'; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Str» <Zoffix__> m: sub { 'foo'.&return; 42 }().^name.say <camelia> rakudo-moar 64e898: OUTPUT: «Int»