in reply to Re: HTML::Mason and "use constant" constants?
in thread HTML::Mason and "use constant" constants?

Interesting, but in a top-level component, <%args> can and is supposed to be overwritten by query string parameters.

I think <%attr> is much better place for these constant-type things, though, since <%attr> is evaluated only once when the component is loaded for the first time and then persists for the life of the child process, and the attributes themselves can't be modified at all after that. Also, component attributes are usually universally accessible even from sub components via $m->base_comp->attr(), saving you from having to use costly <%shared> blocks, touching caller_args(), or passing values explicitly from component to component.

  • Comment on Re: Re: HTML::Mason and "use constant" constants?

Replies are listed 'Best First'.
Re: Re: Re: HTML::Mason and "use constant" constants?
by naChoZ (Curate) on Jan 12, 2004 at 17:57 UTC

    Oh cool. Didn't know about that one. I got the Mason baboon book from Jesse's RT class, but I've only barely cracked the cover.

    --
    Diplomacy is the art of saying "Nice doggie" until you can find a rock.
    naChoZ