いやな日記で紹介されている PAR を試してみた。 PAR は Windows に限らず実行形式のファイルを生成する事ができる (UNIX 系ではメリットは少ないかもしれないが)。
PAR ファイル (ZIP) として必要なスクリプトやモジュールをパッケージ化できるのも嬉しい。 Perl は便利なのだが他人に使ってもらう時に面倒で Java の JAR ファイルが羨しかったのだが、まさにそれを実現してくれる (実行可能ファイルにしてしまうともっとお気楽)。
また PAR ファイルをHTTPサーバ上においておいてリモートから取得できる機能もあり、Java Web Start に近い使い方ができそうである。
Debian BOX に入れて遊んでみた。sid でもパッケージになっていないので dh-make-perl でパッケージ化してつっこむ。
$echo 'print "hello\n";' > hello.pl $perl hello.pl $pp -o hello hello.pl $ls -l hello -rwxr-xr-x 1 naney naney 1739227 2004-07-19 22:09 hello $file hello hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped $./hello hello
$pp -p -o hello.par hello.pl $zipinfo hello.par Archive: hello.par 1184 bytes 5 files drwxr-xr-x 2.0 unx 0 b- stor 19-Jul-04 22:13 script/ -rw-r--r-- 2.0 unx 17 t- defN 19-Jul-04 22:12 script/hello.pl -rw-rw-rw- 2.0 unx 262 b- defN 19-Jul-04 22:13 script/main.pl -rw-rw-rw- 2.0 unx 434 b- defN 19-Jul-04 22:13 MANIFEST -rw-rw-rw- 2.0 unx 214 b- defN 19-Jul-04 22:13 META.yml 5 files, 927 bytes uncompressed, 678 bytes compressed: 26.9% $parl hello.par hello
$pp -o hello -e 'print "hello\n"' $ls -l hello -rwxr-xr-x 1 naney naney 1739237 2004-07-19 22:19 hello $file hello hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped $./hello hello
Naney (なにい)です。株式会社ミクシィで SNS 事業の部長をしています。
nDiki は1999年1月に始めたコンピュータ日誌を前身とする Naney の Web 日記(兼パーソナルナレッジベース)です。ちょっとしたノートは nNote にあります。
※内容は個人的見解であり所属組織とは関係ありません。