3 ms·
Perl6 has remedied the accidental leak of values to the caller by allowing you to give a return value in the signature. This will ignore the last result and re
by b2gills 7y ago
Perl6 has remedied the accidental leak of values to the caller by allowing you to give a return value in the signature.
This will ignore the last result and return Nil instead:
sub foo ( $_ --> Nil ) {…}
This only works with literals, constants and Nil.
If you specify a type instead, it only enforces that the result is of that type.