On Fri, Dec 03, 2004 at 11:36:02PM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall <[EMAIL PROTECTED]> wrote: : > So optimizing to a state variable won't necessarily help your loop : > overhead, but it could help your subroutine overhead, at least in Perl : > 5, if Perl 5 had state variables. Best you can do in Perl 5 is an : > "our" variable with an obscure name. : : my $x if 0; : : I know it's *going* away, but it hasn't *gone* away yet.
That doesn't really suppress reallocation, merely reinitialization to undef, since Perl never deallocates a pad once it's allocated. But yes, it's equivalent to an "our" variable in its lifetime. Might be a little faster or slower to access depending on the CPU architecture. Larry