"goEbusiness.com Mail Lists" wrote:
> Ok, here's the scenarious.
>
> Runnign Text::Template with a PACKAGE. Let's just call it M.
>
> So, for example, I have a script
>
> $M::fill_me_in and Text::Template will fill that variable in.
>
> Anyway, I know that those are global variables, so when I enable mod_perl, they
>retain the previous values.
>
> Is there a quick easy way to reset all of those variables for each time the script
>is run? I'm assuming no. I did make a function that ran through the package, like
>so:
>
> my ($key,$value) ;
>
> foreach $key (sort keys %main::M::) {
foreach $key (keys %::M::){ #the stash is not in any package
>
> my $value = $main::M::{$key} ;
the line above is useless. you were probably using for debugging?
>
> $main::M::{$key} = "" ; # reset to blank
${$::M::{$key}}=undef;
>
> }
>
> and placing that at the bottom of the mod perl enabled script...but it doesn't work.
it will work now.
you may want to rethink your code before going throught this for every call.
also, there might be a better way to reset globals, but the changes i provided should
correct the script above.
>
>
> I tried "reset 'M'" and that also doesn't work.
>
> Any thoughts on this? The short term solution I have come up with is that in every
>sub/package/whatever I reset those variables to blank each time the subroutine that
>would fill those in is called. Is that the best way to do it? I would think the way
>I mentioned above would work, but maybe I just have to call that from each sub
>routinue.
>
> Thanks,
> Bill
> [EMAIL PROTECTED]
--
___cliff [EMAIL PROTECTED]http://www.genwax.com/