in reply to Static variables (and also Perl 6)

Some have tried to explain why static variables are good. I understand it's needed to preserve state, but what's so wrong about the closures we're using right now? ({ my $foo = 3; sub { ... } }) Maybe some filter can provide some syntactic sugar, because that's what this seems to be all about.

I haven't seen Tie::Static in this discussion yet - is tie not good enough?

Update - Putting money where mouth is - I created a filter :)
Filter::Static

Replies are listed 'Best First'.
Re (tilly) 2: Static variables (and also Perl 6)
by tilly (Archbishop) on Jan 27, 2002 at 07:08 UTC
    Note that with Perl 6 we can use := to do what I did with a tie, resulting in the same idea but without most of the overhead.
Re: Re: Static variables (and also Perl 6)
by theorbtwo (Prior) on Jan 27, 2002 at 01:51 UTC