Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: How Are Attributes Useful?

by Limbic~Region (Chancellor)
on Jan 19, 2005 at 15:40 UTC ( [id://423417]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How Are Attributes Useful?
in thread How Are Attributes Useful?

talexb,
After discovering Attribute::Handlers::Prospective and playing around with it for a while, I did find that you can trigger a piece of code to be run at any phase, to include runtime, as a result of using an attribute. What is still unclear to me is:
  • How this can be accomplished without this module. The documentation on attributes is lacking in my opinion and this module was written by TheDamian using source filters afterall.
  • How triggering a piece of code can make a variable read-only, as you suggested previously, or have any other effect on its behavior. The code only gets triggered once, not each time the variable/sub is accessed
So far - it still seems to me to be nothing more than a label that you can attach providing the possibility of other code to react to that label.

...but without either the knowledge of how perl works or the time to delve into the perl code
That is the point of the original question. It seems that a lot of people are in the dark. It also seems that there are a lot of assumptions about what is possible without any code backing it up. It seems to me that it shouldn't be very hard for someone that really understands attributes to post a small snippet demonstrating how to use them.

Cheers - L~R

Update: Added last paragraph moments after hitting submit.

Replies are listed 'Best First'.
Re^5: How Are Attributes Useful?
by Anonymous Monk on Oct 03, 2009 at 09:24 UTC
      Anonymous Monk,
      I am not sure how this adds to the conversation. I already stated:

      ... using source filters afterall.

      I was asking how this could be accomplished without using this module and source filters. Did I miss something in what you were sharing?

      Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found