in reply to Re: Re (tilly) 1: Filter::Static
in thread Filter::Static

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.

Replies are listed 'Best First'.
Re: Re (tilly) 3: Filter::Static
by Juerd (Abbot) on Jan 27, 2002 at 05:16 UTC
    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:~$