in reply to Re: Extending LValuable Subs with Tied Variables
in thread Extending LValuable Subs with Tied Variables

Juerd,
I was hoping you might reply.

If pre and post are always executed directly after eachother, then what's the use of separating them?

I just threw them in there as I wasn't given a real clear definition of how/when they were supposed to be invoked. I assume they would be separate but only perldeveloper can answer that

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.
There is a lot of history from the CB that this post did not capture. After posting it, I did mention in the CB that Attribute::Property might provide aliases in the validation allowing modification if necessary. It is my fault for not looking at the source and not updating my original post accordingly.

Cheers - L~R

  • Comment on Re^2: Extending LValuable Subs with Tied Variables

Replies are listed 'Best First'.
Re^3: Extending LValuable Subs with Tied Variables
by Juerd (Abbot) on Jun 25, 2004 at 08:11 UTC

    I was hoping you might reply.

    How could I not reply? :)

    It is my fault for not looking at the source and not updating my original post accordingly.

    It's documented even. Although it should have been made clearer that the value can also be modified. Currently, only the s/// in the SYNOPSIS really shows that feature.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }