On Fri, Jun 22, 2001 at 04:35:43PM -0400, Brett W. McCoy wrote:
> > On Fri, 22 Jun 2001, Paul wrote:
> > >  $count = () = /$pattern/g;
> 
> However, remember that () is not creating an array, it's creating a list
> context, and then it gets forced into a scalar context.

Except that's wrong, because a list in scalar context returns the last
element of the list, not the count of elements.

What's happening in the code snippet is actually a list assignment, but with
no elements in the list.  A list assignment evaluated in scalar context
results in the number of elements in the list.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to