Koschei has asked for the wisdom of the Perl Monks concerning the following question:
Ok, Perl 5.8.0 introduces runtime application of variable attributes. All fine and dandy. However, I'd like to be able to pass variables in my attribute declarations. For example:
my $bar = 3; my Cat $foo : Legs($bar);As perldelta (perl58delta for bleaders) says:
In particular, however, this allows variable attributes to be useful for "tie" interfaces, which was a deficiency of earlier releases.
So, how does one actually evaluate the $bar? MODIFY_SCALAR_ATTRIBUTES gets called with a string "Legs($bar)" and no hook into the appropriate namespace.
-- Iain, aka Koschei.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: runtime variables and runtime attributes.
by IlyaM (Parson) on Jul 22, 2002 at 08:13 UTC | |
by Koschei (Monk) on Jul 25, 2002 at 01:56 UTC |
Back to
Seekers of Perl Wisdom