in reply to Initialization of "local static" (style question)

In a modern Perl (like one released in 2007), I would use 'state' to get a static variable:
sub f { state $myval = myfunc (); ... g(++$myval); }

Replies are listed 'Best First'.
Re^2: Initialization of "local static" (style question)
by rovf (Priest) on Feb 03, 2009 at 11:21 UTC

    I hadn't known about state, but since the code must be run on 5.8.8, this is not an option yet.

    -- 
    Ronald Fischer <ynnor@mm.st>