Perl

Perl

Perl

perl_5.6.1-8.3-5_arm.ipkをインストール。
(このパッケージには,以下のモジュールが既に含まれている)

libCGI-perl_5.6.1-2.97_arm.ipk
libClass-perl_5.6.1-030721_arm.ipk
libFile-perl_5.6.1-030721_arm.ipk
libTime-perl_5.6.1-030721_arm.ipk

インストール後に「インストールエラー」と出て「このソフトウェアは、他のソフトウェア(ライブラリなど)を必要としています~」とあるが無視してOK。
正しくインストールされていれば,次のコマンドでPerlのバージョン情報が出る。

bash-2.05$ perl -v

This is perl, v5.6.1 built for arm-linux

Copyright 1987-2001, 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.com/, the Perl Home Page.

Perl実行時に以下のようなwarningが出ることがある。

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "ja"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

実害はないが,気になる場合は「/home/zaurus/.bashrc」と「/home/root/.bashrc」に以下を追加する。

export PERL_BADLANG=0

(これだけではエラーがなくならなかったので,パーミッションを775に変えてみたがどうなんだろう……)


Perlの実行

/home/zaurusにhello.plを作る。

# vi ./hello.pl
my $message = "Hello, World!\n"; 
print $message; 

これを実行。

$ perl hello.pl
Hello, world!

次に,ファイル名だけで実行するようにする。

!#/usr/bin/perl 
my $message = "Hello, World!\n"; 
print $message; 

とし,

# chmod 775 ./hello.pl

でパーミッションを与えて実行すると

$ ./hello.pl
Hello, world!

これでOK。


CGI実行環境

Apacheを参照。


ref

最終更新:2009年04月13日 23:37