in reply to Re: Re: Optimization of array looping...
in thread Optimization of array looping...

I think you are a bit confused.

Taking a look at perldoc perlvar, one might note that $# is deprecated. This is not the same $#array of which you speak. Your code above breaks whenever anyone bothers changing $[ (perhaps an insane programmer wishing to update your code?). Your code above should instead be written as:

@parent[3..@parent-1+$[]

Of course, @parent - 1 + $[ is a long way of saying $#parent. So why not just use it?

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.