in reply to Timing of Array-Size Determination Methods

Thanks to everybody for the responses. The main reason why i posted this why I posted this wasn't to show a statistically significant difference between the three methods (although there does seem to be one). It was more to inquire as to why that difference exists. Certainly we're talking on the order of milliseconds in most programs, as Meryln pointed out.

Nevertheless, using the "context" method as a base, the other methods are 20-40% slower, and I'm not familiar enough with PERL to rationalize that in terms of the internals.

hardburn pointed out that the construction of the @_ variable in the scalar() call is probably a major factor. That seems reasonable, and I could imagine testing it by passing an arrayref to a custom-written version of scalar. But I don't really understand why $#array is so much slower?

-Tats