On 2/17/06, Ryan Perry <[EMAIL PROTECTED]> wrote:
What's the "best" way for me to turn .mas files I created (without
content) into subroutines in a module?  I know they should have been
inside a module to start, but they aren't...

My concerns are preserving the default values from my %args section,
and how I should pass the values.

Thanks for the advice!

Ryan

I typically define a new() interface an map Params in .
sub new{
         my $class=shift;
         my $self = [EMAIL PROTECTED];
          if (defined($self->{Test})){
                    ...do something else.
          };
          return bless ($self,$class);
};

then in maosn space..
<%once>
         use MyModule;
</%once>
<%args>
           $test=>1
</%args>
<%init>
      my $mymodule = MyModule->new(Test=>$test);
</%init>
The value of test is <% $mymodule->{Test} %>

I'm sure there are more elegant solutions, but I like having the granularity.

Rod

Reply via email to