in reply to Re: Re: Re: Re: RFC - inplace upgrade for Tie::SortHash
in thread RFC - inplace upgrade for Tie::SortHash
Yes, and its exactly equivelent to
return $self->[ARRAY][$index];
What is the point of the if in your code? If the values of $self->[ARRAY][$index] is defined then we return the value. If its not then we return undef. Whats the point? The value of $self->[ARRAY][$index] should simply be returned. There is no difference. (Except the one is more efficient and less confusing.)
Consider this using different values:
sub foo { my $x=shift; if ($x=10) { return 10; } else { return $x; } }
Which is just plain silly isn't it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: RFC - inplace upgrade for Tie::SortHash
by Limbic~Region (Chancellor) on Sep 05, 2003 at 22:38 UTC |