Thank you for looking at this from another perspective.
The more I investigate this, the more I'm convinced that the source of the problem is my having bought into the monoculture of OO syntax, whilst not wanting to give up the convenience and flexibility of being able to tailor the syntax to the task.
Once that realisation dawned, it looked more closely at whether I was actually benefiting elsewhere from OO for this particular application, and I've pretty much concluded no.
Since then, I've made some progress. My ideal situation would be to use an lvalue accessor to the properties and that seemed ideal until I discovered that the actual assignment to the underlying value accessed via an lvalue sub is done outside of the scope of that sub.
That is, in the following:
my $x;
sub x :lvalue {
use somepragma;
$x;
}
x() += 1;
The assignment of 1 to $x is not subject to somepragma. And that was the purpose of using an accessor in the first place.
Dropping the OO and using the anonymous block syntax seems to be my best bet at this time. Now I'm investigating appying the :shared attribute to an entire namespace.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|