modern_perl_book icon indicating copy to clipboard operation
modern_perl_book copied to clipboard

Mention how "$" prototype forces scalar context on a parenthesized list

Open dagolden opened this issue 14 years ago • 0 comments

Either in the section that discusses arrays vs lists, or in a section on prototypes, it might be worth pointing out the (possibly) surprising behavior of this:

sub foo($$$) { say "@_" } foo( (1,2,3), 4, 5 ); # prints: 3 4 5

dagolden avatar Nov 26 '10 04:11 dagolden