On Fri, 22 Jun 2001, iansmith wrote:

> Which is what array() should do.. force the inside of the paren to
> be a list context, just like scalar() forces a scalar context.
>
> $count = scalar( () = /$pat/g ); is the same as the above example.
>
> $count = scalar( array( /$pat/g ) ); should work, if array existed.
>
> Admittedly, there are more important and meaningful things to add.  :-)

But then it should be list(), not array().  There is list context and
scalar context, but not array context.  Anyway, () is usually enough to
force a list context, if appropriate (we saw yesterday a case where it
doesn't).  scalar() was created because there was no operator
already to force a scalar context.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
You know it's going to be a long day when you get up, shave and shower,
start to get dressed and your shoes are still warm.
                -- Dean Webber


Reply via email to