師匠の散歩

きままにPerlでも

show Perl Version

Perl Versionを表示する/ checkPerlVersion.cgi

Webサーバーの場合

print $];                                 # 簡易的にバージョンを調べる
$perlversion = `/usr/local/bin/perl -v`; # 使用しているサーバーのパスにあわせる
                     # /usr/bin/perl -v でもエラーにならなかった。
if ($perlversion eq "") { 
  # データが無い場合は、PCのバージョンを調べる
  $perlversion = `c:/Perl64/bin/perl -v`; # PCのパスが合っていないといけない
}
if ($perlversion eq "") {
 $perlversion = "Perlのバージョンを調べることができませんでした。";
}
print $perlversion;
5.016003
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 40 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Windowマシンの場合

Active Perlの場合、次の手順でバージョンを調べることができる。

  1. DOSプロンプトを起動する
  2. Active Perl をインストールしているパスに移動する
  3. その下のbinに移動する
  4. perl -vと入力するとバージョンが表示される。
C:\Documents and Setting\username>cd c:\Perl
C:\Perl>cd bin
C:\Perl\bin>perl -v

This is perl, v5.10.1 built for MSWin32-x86-multi-thread
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2009, Larry Wall

Binary build 1007 [291969] provided by ActiveState http://www.ActiveState.com
Built Jan 26 2010 23:15:11

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

perl/strawberryバージョンの内容も掲載しておく。

C:\strawberry\perl\bin>perl -v

This is perl 5, version 12, subversion 1 (v5.12.1) built for MSWin32-x86-multi-t
hread

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

2020年でのActive Perlの内容も掲載しておく。

This is perl 5, version 26, subversion 3 (v5.26.3) built for MSWin32-x64-multi-thread
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2018, Larry Wall

Binary build 0000 [4d5793b2] provided by ActiveState http://www.ActiveState.com
Built Dec 18 2019 22:29:21

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


checkPerlVersion.cgi // Topに戻る // indexに戻る
Copyright(C) 2009-2021 Grandmaster Last up : 2020/09/22