in reply to Filter::Static

Ouch.

Tie::Static was a first pass which is at version 0.01 for a reason. I created a second pass at Tie::Static take 2 with unfortunately a somewhat incompatible (but much better) API, but then got bogged down while writing tests and never released that to CPAN. (Like a fool I thought that nobody was using it.)

If you want to release something relying on that, I should release the second version first... :-(

Replies are listed 'Best First'.
Re: Re (tilly) 1: Filter::Static
by Juerd (Abbot) on Jan 27, 2002 at 03:10 UTC
    Your functional interface provides for easy syntax. So please upload your take 2, so there's no need for Filter::Static at all :)

    Update - or maybe the filtered one will still be easier to use. I'm now thinking of adding a counter so multiple statics can be defined on a single line, and I think the filtered version allows for more perlish syntax. Hmmm... what do you think?
    Update2 - as far as I can see, the tied interface didn't change, which would mean I can upload the filter before you upload your new version - Or did I fail to see some obvious change?

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

      The API changes were fairly minor. If you pass additional arguments to the tie you can define any kind of sharing behaviour you want between different scopes. The old one used @_ only to allow you to have multiple ties on the same line. (I take it you encountered this?)

      As for additional comments, I think it would be bad for both of us to be making available something named static that do rather different things. One or the other of us needs to rename theirs. I don't care which, but as they stand the APIs conflict in a non-trivial way.

        Tie::Static 0.01 uses (caller, @_), 0.02 uses just @_ - am I right?
        That's why I let Filter::Static add caller() if the newer Tie::Static is used.

        As for the use of the name "static", the two statics are more similar than select() and select() are. I don't think there will be users that use Tie::Static (and import static) and Filter::Static in the same script. If they do, It's not a great problem, because the backslashes break the variable matching pattern (/[\$\@%]\w+/) and are kind of required to create the references :) (I don't think my $foo = "hello"; my $bar = \$foo; static $bar is likely to happen.)
        In short: I don't think this will be any problem at all.

        2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$