>>>>> "iansmith" == iansmith <[EMAIL PROTECTED]> writes:
iansmith> On Fri, 22 Jun 2001, Paul wrote:
>> $count = () = /$pattern/g;
iansmith> This seems like a place that an array() operator like scalar()
iansmith> woudl be usefull. Then you could do '$count = array(/$pat/g);'
iansmith> instead. I know the above works well, but it would be nice for
iansmith> completeness to have array() as well as scalar().
That one wouldn't be called "array", it'd be called "count" or
something. Since an array can't exist in a scalar context, there's no
reverse equivalent of scalar() (which forces a scalar context as an
element in an array upgrade).
We've hashed this out before in the newsgroup. There can't be an
equivalent. There can't.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!