[EMAIL PROTECTED] wrote:
>
> To avoid passing many parameters to the subs I become using a $cx (cx stand for
> context) global hash containig everything the subs needed, passed to each sub.
>
> page test.asp
> $cx = {};
> $cx->{'name'} = 'default name';
> $cx->{'age'} = 30;
> ...
Try this,
# in global.asa
use vars qw($cx); # set up $cx for global use
sub Script_OnStart {
$cx = {}; # initialize per request
}
# in script
sub HelloWorld {
$cx->{name} = 'hello';
}
This will work, but I'd recommend you move your subs to
global.asa, which is your central module for your scripts.
And then you can use $Server->Transfer() to change
the file executing midstream.
--Josh
- modperl/ASP and MVC design pattern Francesco Pasqualini
- Re: modperl/ASP and MVC design ... Brett W. McCoy
- Re: modperl/ASP and MVC design ... Joshua Chamas
- Re: modperl/ASP and MVC design ... Ian Kallen <[EMAIL PROTECTED]>
- Re: modperl/ASP and MVC des... Francesco Pasqualini
- Re: modperl/ASP and MVC... ed phillips
- Re: modperl/ASP and ... f . pasqualini
- Re: modperl/ASP... ed phillips
- Re: modperl/ASP and MVC design ... Joachim Zobel
- Re: modperl/ASP and MVC design ... f . pasqualini
- Re: modperl/ASP and MVC des... Joshua Chamas
- Re: modperl/ASP and MVC... Francesco Pasqualini
- Re: modperl/ASP and ... Joshua Chamas
- Re: modperl/ASP and MVC design ... Francesco Pasqualini
- Re: modperl/ASP and MVC des... T.J. Mather
- Re: modperl/ASP and MVC des... Perrin Harkins
- Re: modperl/ASP and MVC... Gunther Birznieks
- Re: modperl/ASP and MVC des... Joachim Zobel
