If you read perldoc perlop under "Assignment Operators", you can see that that's how it's defined. When the designers of perl made decisions for the semantics of the action, it seems that they thought the most useful result of assigning an array to a scalar was to give the length of the array. Having used perl for a few years now, I find that the choice is a pretty useful one.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: array in scalar context..
by roboticus
in thread array in scalar context..
by abhishekv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |