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

Re^2: How Are Attributes Useful?

by Ovid (Cardinal)
on Jan 18, 2005 at 22:47 UTC ( [id://423211]=note: print w/replies, xml ) Need Help??


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

chromatic wrote:

In a recent journal entry (Dark, Dark Corners of Perl), I speculated that it's possible to use attributes on methods to simplify declaring and accessing parameters. I'm not ready to demonstrate my proof of concept yet, but I really like how the syntax works. It's nice to be able to manipulate subroutines at the appropriate time without resorting to source filters.

I wholeheartedly agree, and between the two, I would use your solution over mine any day of the week if it's feasible, but I have a couple of questions. First, can you do multi-method dispatch with that? I've been porting some Java to Perl and lack of MMD has been a pernicious source of bugs.

Second, will this run under mod_perl? It's my understand that attributes rely on a CHECK block. That won't get triggered under mod_perl. I know we discussed this the other day, but for the life of me, I can't recall what was said :)

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^3: How Are Attributes Useful?
by chromatic (Archbishop) on Jan 19, 2005 at 00:16 UTC

    I think it'd be very easy to do MMD with this technique. There's one potentially tricky spot, but I think it's doable.

    I also think attributes will run just fine under mod_perl. Maypole uses them, for example, and it works. There are different ways to declare where Attribute::Handlers runs, for example.

Re^3: How Are Attributes Useful?
by perrin (Chancellor) on Jan 19, 2005 at 00:15 UTC
    I don't use attributes, so I can't vouch for it either way, but if they don't work under mod_perl, someone should tell the Maypole developers that. It uses sub attributes for security purposes.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found