On 21 Jun 2009, at 01:09, Jamie Lokier wrote: > I find @array in scalar context a nice way to get the > number of elements in Perl 5, though it is a bit too implicit for the > unfamiliar reader.
It doesn't have to be implicit though. A common pattern is to lob in a literal 'scalar' to make it explicit e.g. $count = scalar @things; I'm not sure it's particularly readable, and the useless invocation of scalar is possibly not optimal, but it unambiguously indicates that there's some kind of transforming operation in there. -- Regards, Colin M. Strickland _______________________________________________ BristolBathPM mailing list [email protected] http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
