Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Extending LValuable Subs with Tied Variables

by Limbic~Region (Chancellor)
on Jun 24, 2004 at 23:43 UTC ( [id://369521]=note: print w/replies, xml ) Need Help??


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' }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-16 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found