in reply to Forcing scalar context
It's easy to do it the other way round - force list context. This can be done with (function(...)).Putting parenthesis around an expression does NOT create list context:
Perhaps you are confused with:sub context {wantarray ? "LIST" : "SCALAR"} my $context = (context); print $context, "\n"; __END__ SCALAR
sub context {wantarray ? "LIST" : "SCALAR"} my($context) = context; print $context, "\n"; __END__ LIST
|
|---|