Re: Tying sub arguments is rare?

[email protected] ("M.J.T. Guy") Wed, 13 Oct 1999 05:51:46 +0100
Newsgroups perl.perl6.porters
Message-ID <[email protected]>
Ken Fox <[email protected]> wrote
> Chip just made a comment to Ilya on p5p that is vaguely troublesome
> to me:
> 
> | > > Would you consider passing \$fido to ALLOCATE?  It would avoid the
> | > > need for some fairly serious pain in Topaz.
> | ...
> | In Topaz, possession of a Scalar* (old: SV*) is not adequate to tie a
> | variable; you need the Scalar** (SV**) so that you can create a new
> | TiedScalar (SV with MAGIC) and make the Scalar** point to it.

This has also concerned me.   You seem to be making tie operate on
a reference to a reference, rather than just a reference.

Does this mean that code like this will break?

     my @a = (1..5);
     my $b = \($a[2]);
     tie $a[2], 'MyWatcher';
     $$b = 4;         # should be seen by watcher


Mike Guy