For my script I am now using local to protect the system from being overridden under mod_perl. I don't really know if it's the right way, it's only the result of trial and failure.
#!/usr/bin/perl use strict; use HSP; if ($ENV{MOD_PERL}) { my @keys = keys %HSP::; my $do = ''; foreach(@keys){ $do .= "local *HSP::$_ = *HSP::$_;"; } $do .= 'HSP::handle();'; eval $do; } else { HSP::handle(); }
In fact, Toolkit, which you mentioned, has an option for variable interpolation, I just found that line that says it in the documentation. It's quite helpful when coding a template with an ASP capable editor. The code blocks appear in clickable boxes and the variables can be entered in the visible HTML. Only TT2 does use square brackets [% %] by default which should be changed to <% %> then.
However just for my personal pleasure I would like to put perl within the brackets so I can have everything in one place. I have long enough put everything in the cgi-bin and started with #!/usr/bin/perl, I need a change!! Playing with this saves me from switching to php.
In reply to Re: Re: Re: Re: Overriding Subroutines in Package
by Tetramin
in thread Overriding Subroutines in Package
by Tetramin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |