Keep It Simple, Stupid | |
PerlMonks |
Re: Extending LValuable Subs with Tied Variablesby Juerd (Abbot) |
on Jun 24, 2004 at 22:54 UTC ( [id://369511]=note: print w/replies, xml ) | Need Help?? |
If pre and post are always executed directly after eachother, then what's the use of separating them? What part of the story am I missing here?
[Attribute::Property] doesn't actually provide hooks for pre/post "processing" It provides a single hook for processing and validation: the code block. The value returned by it determines whether the new value is correct (hence the 1 in the example above), but both $_ and $_[1] are aliases for the value that is about to be set, so there's more than enough chance to manipulate the value before it gets assigned. It should be noted that I also have no idea what C# does. I tried googling, but found only one sort-of relevant document, which has no examples and no explanation that I immediately grokked. Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
In Section
Seekers of Perl Wisdom
|
|