in reply to Re^3: Printing accessor methods in here documents
in thread Printing accessor methods in here documents
Uh, not exactly. It actually evaluates in list context but treats the return as if it were in scalar. Like so:
#!/usr/bin/perl -wl my @x = qw[ a b c d ]; sub x { print wantarray ? "list context" : defined(wantarray) ? "scalar context" : "void context"; @x } print "@{[ x() ]} - ${\ ( x() )} - ${\ ( @x )}"; __END__ list context list context a b c d - d - d
|
|---|