My module is an interface to data dictionary based system that reads and
writes all data thru a C function.
I currently have a blessed reference that automagically does accessing.
eg: my $accno = $SYUS->ACCNO;
$SYUS->ACCNO($accno);
That all works just fine.
Needless to say some people have asked whether I can arrange for
$SYUS->ACCNO = $accno;
to work. Ie lvalue subroutines. I already have something that ties
variables and pollutes the namespace so "$SYUS::ACCNO = $accno" would
work, but that seems to be quite slow compared to accessors and also it
pollutes the namespace badly (there are several 100 data dictionary
names that get used in some of these programs).
I can see how to do lvalues in pure perl (sub ACCNO : lvalue {..}) but
how do I mark an XS routine similarly? What are the gotchas?
I currently return the value after change in the accessor anyway, so
that isn't problem and I am not doing anything which would worry me with
regard to the constraints set out in perlsub.
Dirk