perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <j...@chamas.com>
Subject Re: Porting from ActivePerl/IIS to Apache::ASP
Date Fri, 16 Jul 2004 19:28:49 GMT
Quoting Warren Young <warren@etr-usa.com>:

> Unknown wrote:
>
> > Our problem is the original authors of the code assumed variables are
> > not globally scoped.
>
> You mean one of the original authors doesn't understand Perl.
>

Besides Warren's excellent response to your original email, I would like to add
a few things...

> > Q1.1: How come in other languages, the scope of the variable is
> > assumed to be for the page unless
> > defined otherwise (e.g. PHP, ActivePerl, VBScript)?
>
> First, drop ActivePerl from that.  That's a different issue entirely.
> Second, the reason has to do with Perl's history, but it's really not
> important to argue about it here -- do that on comp.lang.perl.misc.
>

Consider the alternative to caching things where globals and such persist, the
cost and overhead to resetting things things can be expensive.  If you really
want things to be cleaner, you can set NoCache 1 which will at least recompile
scripts each time.

> > Q1.2: Is there a configuration option or easy way around this issue?
>

Settings "UseStrict 1" is a great way to find out which one of your scripts has
variables incorrectly declared.

> Yes.  Put it in a Perl module instead, and either "use MyModule" from
> each ASP file that needs the routine, or "use" the module in global.asa.
>

You can also move the subs to the global.asa for auto import to your scripts.

> The main downside of this is that you will have to restart Apache each
> time you change one of the Perl modules, since Apache::ASP won't
> recompile the scripts when a module changes.
>

Try also Apache::Reload and StatINC settings to deal with the reload issue while
developing.

Regards,

Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message