代码之家  ›  专栏  ›  技术社区  ›  Flo Edelmann

有类似`<的东西吗?php phpinfo()?>`在Perl中?

  •  5
  • Flo Edelmann  · 技术社区  · 14 年前

    <?php phpinfo(); ?> 在Perl中?

    4 回复  |  直到 14 年前
        1
  •  11
  •   brian d foy    14 年前

    你想知道什么信息? phpinfo

    输出有关PHP当前状态的大量信息。这包括有关PHP编译选项和扩展、PHP版本、服务器信息和环境(如果编译为模块)、PHP环境、操作系统版本信息、路径、配置选项的主值和本地值、HTTP头以及PHP许可证的信息。

    您可以在Perl中以某种方式获得其中的大部分内容,但并非所有内容都来自同一个地方。

        2
  •  6
  •   cjm    14 年前
    use Config qw(myconfig);
    
    print myconfig();
    

    perl -V 做。您还可以通过 Config

        3
  •  1
  •   tinonetic    10 年前

    我使用的示例脚本如下:

    确保以下行是文件中的第一行:

    #!/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";
    }
    

    资料来源: http://cgi.bw.org/cgi-t/

        4
  •  0
  •   Josh K    14 年前

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