How do I set Perl's %ENV to introduce a Perl script into the context of my web application?
I have a website, written in a language different from Perl (Python). However I need to use a Perl application, which consists of a .pl file:
#!/usr/bin/env perl
"$ENV{DOCUMENT_ROOT}/foo/bar.pm" =~ /^(.+)$/;
require $1;
my $BAR = new BAR(
user => 'foo',
);
print $bar->get_content;
... and a module bar.pm, which relies on "$ENV{HTTP_HOST}"
, "$ENV{REQUEST_URI}"
,
"$ENV{REMOTE_ADDR}"
and "$ENV{DOCUMENT_ROOT}"
.
How should I set this hash? This is my very first experience with Perl, so I may be missing something really obvious here :)