Is there something like `<? Php phpinfo ();?> `In Perl?

Is there something like <?php phpinfo(); ?>in Perl?

+5
source share
4 answers

What information do you want to know? phpinfo obviously tells you almost everything:

Displays a large amount of information about the current state of PHP. This includes information about parameters and extensions of the PHP version, version of PHP, information about the server and environment (if compiled as a module), PHP environment, information about the OS version, paths, main and local values ​​of configuration parameters, HTTP and PHP headers license.

You can get most of this somehow in Perl, but not all from the same place.

+11
use Config qw(myconfig);

print myconfig();

, perl -V. Config.

+5

bash.

$ perl --version # This is what I would use
0

, Perl bin .

script:

, :

#!/usr/bin/perl

- ( ):

#!C:/wamp/bin/Perl64/bin/perl.exe

:

#!/usr/bin/perl
# test.cgi by Bill Weinman [http://bw.org/]
# Copyright 1995-2008 The BearHeart Group, LLC
# Free Software: Use and distribution under the same terms as perl.

use strict;
use warnings;
use CGI;

print foreach (
    "Content-Type: text/plain\n\n",
    "BW Test version 5.0\n",
    "Copyright 1995-2008 The BearHeart Group, LLC\n\n",
    "Versions:\n=================\n",
    "perl: $]\n",
    "CGI: $CGI::VERSION\n"
);

my $q = CGI::Vars();
print "\nCGI Values:\n=================\n";
foreach my $k ( sort keys %$q ) {
    print "$k [$q->{$k}]\n";
}

print "\nEnvironment Variables:\n=================\n";
foreach my $k ( sort keys %ENV ) {
    print "$k [$ENV{$k}]\n";
}

Source: http://cgi.bw.org/cgi-t/

0
source

All Articles