On Thu, 18 May 2000, Kenneth Lee wrote:
> modperlers,
>
> does it make sense if i put some mod_perl specific codes inside
> an eval() so that the code runs on machines that have or haven't
> mod_perl installed?
>
> eval <<'MOD_PERL_CODE' if $ENV{MOD_PERL};
> use Apache ();
> my $r = Apache->request;
> ...
> MOD_PERL_CODE
Better still:
eval {
die unless $ENV{MOD_PERL};
require Apache;
my $r = $Apache->request;
...
};
Then you've got no (at least much less than the above) run-time overhead.
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org