perl cgi on command line

Apr 30, 07:31 AM

### notice this is ONE LINE! DOCUMENT_ROOT=/home/comptonpeslonline.com/public_html \ HTTP_HOST=comptonpeslonline.com \ QUERY_STRING=‘one=twooo&three=fourrrr’ \ /home/comptonpeslonline.com/cgi-bin/perlinfo.pl ;

perlinfo.pl script:

#! /usr/bin/perl
  1. script to simulate phpinfo() command
    use strict;
    use warnings;
    use Config;
    use CGI;
    use Data::Dumper;

my $q = CGI->new;
print $q->header(‘text/plain’);

print “Perl Version: $^V” ;
print “nnArchitecture: $Config{archname}” ;
print “nn” ;

foreach my $key (sort keys %ENV) { print “$key = $ENV{$key}n” ;
}

Mark Edwards

,

---

Commenting is closed for this article.

---