develooper Front page | perl.perl5.porters | Postings from February 2018

Re: getting at the "invoked" tied variable

Thread Previous
From:
Father Chrysostomos
Date:
February 11, 2018 18:08
Subject:
Re: getting at the "invoked" tied variable
Message ID:
20180211180745.3918.qmail@lists-nntp.develooper.com
I wrote:
> My previous response was rather quick and I had not thought it
> through.  It's tricky.
> 
> If you want to localise your tied-variable variable properly, then you
> will have to forego Perl's tie mechanism and implement your own, which
> you will of course call from your own get- and set-magic routines.
> 
> If you think that recording the tied variable does not need to be
> undone after the FETCH/STORE call (so the scope is similar to $!),
> then cast after tying.  The last magic to be attached is trig-
> gered first.

And you would probably want to store a weak reference to the tied var-
iable if you use that approach.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About