On 2 Mar 2009, at 21:01, Nigel Peck wrote:
> When the list could be empty, which is faster?
>
> if ( @list ) { foreach ( @list ) { } }
>
> - or just -
>
> foreach ( @list ) { }
>
> Or is it a pointless question?
Yes :)
Benchmark it - but I bet there's not much difference - and the second
version will be faster in the non-empty case.
--
Andy Armstrong, Hexten