[Dancer-users] What's my route handler?

David Cantrell david at cantrell.org.uk
Thu Feb 16 00:25:23 CET 2012


On Wed, Feb 15, 2012 at 07:51:59PM +0000, David Precious wrote:

> FWIW, I had a very brief try at extracting sub attributes from the
> handler coderef and couldn't get it to work - but I also couldn't get
> it to work in a brief non-Dancer test case just creating a coderef
> with attributes then getting the attributes from it - so it's more
> likely a case of me Doing It Wrong.

Attributes are poorly documented Dark Magic so probably the latter.
No doubt it's in there somewhere, but it's carefully hidden.

The best explanation I've found of how to create custom attributes is
here:

http://stackoverflow.com/questions/987059/how-do-perl-method-attributes-work

The only thing Dancer-specific that I can imagine getting in the way
would be if internally my code-ref gets wrapped in another code-ref.

-- 
David Cantrell | Bourgeois reactionary pig

The word "urgent" is the moral of the story "The boy who cried wolf". As
a general rule I don't believe it until a manager comes to me almost in
tears. I like to catch them in a cup and drink them later.
               -- Matt Holiab, in the Monastery


More information about the Dancer-users mailing list