Using the default installation of Mac OSX 10.3/Apache
1.3.29/mod_perl-1.26/Perl 5.8.1RC1, the following script:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header(), start_html(), '';
for (sort keys(%ENV)) {
print "$_ = $ENV{$_}\n";
}
print '', end_html();
exit(0);
... wor
Garry Heaton wrote:
Using the default installation of Mac OSX 10.3/Apache
1.3.29/mod_perl-1.26/Perl 5.8.1RC1, the following script:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header(), start_html(), '';
for (sort keys(%ENV)) {
print "$_ = $ENV{$_}\n";
}
print '', end_html();
e
Stas Bekman wrote:
> That's not what your server returns, that's a fake page that your
> browser gives to you. You need to test with a command line tool, like
> LWP's GET, lynx, links or whatever is available on your OS.
>
> I remember someone asked that question before. Something about STDOUT
>
Sorry, Stas, I jumped the gun editing your original. Just tested:
#!/usr/bin/perl -w
use strict;
use diagnostics;
my $r = shift;
$r->print("Content-type: text/plain\n\n");
$r->print("It works");
./test.pl produced:
Can't call method "print" on an undefined value at ./test.pl line 6 (#1)
(F) Yo
On Sun, 2004-04-25 at 21:09, Garry Heaton wrote:
> It works but can you explain what value $r receives from 'shift' when no
> argument is supplied via @ARGV?
When you run a script under Apache::Registry, it gets passed an Apache
request object automatically. That's what you are grabbing with that
Garry Heaton wrote:
Stas Bekman wrote:
That's not what your server returns, that's a fake page that your
browser gives to you. You need to test with a command line tool, like
LWP's GET, lynx, links or whatever is available on your OS.
I remember someone asked that question before. Something about
You can not run this script in the shell because it expects a
Apache::Request-Object which is passed by Apache::Registry to you. Why
you are getting Apache::Request is because Apache::Registry is wrapping
your "CGI"-Code in an subroutine. The code run inside mod_perl looks
something like the fo