So in this example, wantarray() reports 1, which implies a list context, whereas i thought that it would report a scalar context. Im not too surprised, because if blah() were assigning directly to a hash, wantarray() should report 1. In my example, blah() is sort of assigning to a hash.my %hash = ( 1 => blah(), } sub blah { print "wantarray = " . wantarray() . "\n"; }
Just sort of unexpected!
In reply to wantarray - surprise behaviour by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |