Right answer, but I don't approve of your explanation. The reason that you get a count is because a list assignment in a scalar context returns the number of elements on its right-hand side.
There are a ton of other "operations that would return a list if used in a list context" [often sloppily (: referred to simply as "lists" ] that would return different information if used in a scalar context.
- tye (but my friends call me "Tye")In reply to (tye)Re: Getting the number of times a regexp matches
by tye
in thread Getting the number of times a regexp matches
by MeowChow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |