On 24 Sep 2004, at 03:26, Justin Mason wrote:
argh, yes:
foreach my $rule (@{$self->{conf}->{biglistofrulenames}) { # do something read-only with $rule }
you're right, that *will* incr the refcount on every entry in that array, touching the page and triggering copy-on-write.
You can use for (0.. $#{$self->{conf}->{biglistofrulenames}}) and then reference direct into the array.
But you're probably going to copy the rule at some point anyway. It's very hard to get this stuff right.
Matt.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
