|Think about Loose Coupling|
Re: my $x or my ($x)by davidrw (Prior)
|on Apr 04, 2006 at 13:24 UTC||Need Help??|
for the behavior, besides all of the above posts, also consider this simple example:
Because, in scalar context, an array variable will evaluate to it's length.
I'd say that, in general, it's "more appropriate" to declare in list context only when list context is actually needed -- e.g. declaring multiple variables at once, or sometihng like the my ($z) = @x; above where you're working w/ an array on the RHS.
Another common use of list context: