Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/[localpath]/perlbrew/perls/perl-5.24.0/bin/perl -d
- use strict;
- use warnings;
- use CGI;
- my $q = CGI->new();
- print "Content-type: text/htmlnn";
- print "<p>key = " . $q->param('myparam') . "</p>n"; #this is always empty
- my @names = $q->param;
- foreach my $name (@names) {
- print "<p>$name = " . $q->param($name) . "</p>"; #this never runs
- }
- my $postdata = '';
- my $in = *STDIN;
- my $bytes = read($in, $postdata, $ENV{'CONTENT_LENGTH'});
- print "<p>postdata = $postdata</p>n"; # postdata is empty
- print "<p>content length = " . $ENV{'CONTENT_LENGTH'} . "</p>n"; # this number seems correct
- foreach my $key (keys %ENV) {
- print "<p>$key --> $ENV{$key}</p>n"; # nothing special here
- }
- ...
- LoadModule cgi_module modules/mod_cgi.so
- LoadModule perl_module modules/mod_perl.so
- ...
- ScriptAlias /cgi-bin/ "/[siteroot]/cgi-bin/"
- Alias /perl/ "/Applications/MAMP/cgi-bin/"
- <IfModule perl_module>
- PerlModule ModPerl::Registry
- <Location /perl>
- SetHandler perl-script
- PerlResponseHandler ModPerl::Registry
- PerlOptions +ParseHeaders
- Options +ExecCGI
- </Location>
- </IfModule>
- > perlbrew list-modules
- CGI
- Date::Parse
- Encode::Locale
- HTML::Parser
- HTML::Tagset
- HTTP::Date
- HTTP::Message
- IO::HTML
- LWP::MediaTypes
- Perl
- Sub::Uplevel
- Test::Deep
- Test::Needs
- Test::NoWarnings
- Test::Warn
- Try::Tiny
- URI
Add Comment
Please, Sign In to add comment