Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

perl

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

like image 895
Flo Edelmann Avatar asked Sep 18 '10 05:09

Flo Edelmann


2 Answers

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

Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.

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

  • The Config module, which comes with Perl, has the compilation options for the interpreter
  • The Probe::Perl might give you a better interface
  • $^V has the version of the current interpreter (see perlvar)
  • %ENV has the environment (see perlvar)
  • You can use the Devel::CheckOS module to find out about the OS
  • Unless you are using mod_perl, your Perl CGI script will probably not have direct access to HTTP headers
like image 76
brian d foy Avatar answered Sep 21 '22 01:09

brian d foy


use Config qw(myconfig);

print myconfig();

prints much of the information that perl -V does. You can also get individual elements of that information through the Config module.

like image 39
cjm Avatar answered Sep 21 '22 01:09

cjm