princepawn has asked for the wisdom of the Perl Monks concerning the following question:

I stared and stared the examples and docs for Attribute::Handlers, but I don't really know what the practical usage of them would be.

Could someone mention how they benefit code that they are developing? Gracias.

  • Comment on Attribute::Handlers -- the practical use?

Replies are listed 'Best First'.
(boo)Re: Attribute::Handlers -- the practical use?
by boo_radley (Parson) on May 10, 2001 at 23:55 UTC
    glancing over the p5p list over on http://www.perl.com, I see that these attributes are apparently being used in a development version of perl, like so:
    our $sv : shared = "foo";
    in this case, the shared attribute means that when $sv is being altered (they say written to, but that seems a bit foreign) that all reads are locked out until the write is complete. You now have a method of implementing multithreaded multiprocessor vars. I can't tell you how this locking is achieved behind the scenes, but there's one possible use.

    reference p5p digest for 06MAY2001.

Re: Attribute::Handlers -- the practical use?
by $code or die (Deacon) on May 10, 2001 at 23:54 UTC
    Can't think of anything of the top of my head, but it reminds me of what Larry said in Apocalyse 2 about sticking post-it(tm) notes on things.

    Thanks for the heads-up, it's good to find new and interesting modules that you didn't know were there.

    $code or die
    $ perldoc perldoc