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

I believe the proper place for would be in the <%ARGS> section. For instance, in one of my custom RT forms, my ARGS section is:

<%ARGS> $DependsOn => undef $DependedOnBy => undef $MemberOf => undef $QuoteTransaction => undef $Queue => 35 </%ARGS>

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

Replies are listed 'Best First'.
Re: Re: HTML::Mason and "use constant" constants?
by William G. Davis (Friar) on Jan 09, 2004 at 14:55 UTC

    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.

      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