in reply to inline caching a list-generating sub
Something like this? :-)
sub foo { $list = $foo_cache{join ',', @_} ||= [ do { ... rest of sub goes here }]; want_array ? @$list : $list; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: inline caching a list-generating sub
by Roy Johnson (Monsignor) on Aug 19, 2005 at 14:36 UTC |
In Section
Seekers of Perl Wisdom