Shell::Perl と pirl を試してみる
id:naoya氏がブクマしてたのを見て入れてみた。
                                 pirlは、perlshのような対話型のperlシェルです。
Shell::Perlをinstallしようとすると、新しいExtUtils::MakeMakerを要求されるので、cpanコマンドでいれずに、Makefile.PLを書き換えた
                              
-use ExtUtils::MakeMaker 6.31; +use ExtUtils::MakeMaker;
                                 同時にinstallされるpirlコマンドを実行するとこんな感じ。
                              
$ pirl [~] Welcome to the Perl shell. Type ':help' for more information pirl @> 1+1 2 pirl @> log 10 "2.30258509299405" pirl @>
                                 :helpでヘルプがでる。
                              
pirl @> :help Shell commands: (begin with ':') :exit or :q(uit) - leave the shell :set out (D|DD|Y) - setup the output with Data::Dump, Data::Dumper or YAML :set ctx (scalar|list|void|s|l|v|$|@|_) - setup the eval context :reset - reset the environment :h(elp) - get this help screen
                                 outputの形式をYAMLなどにできるのでそれをやってみる。
                              
pirl @> :set out Y
pirl @> {a=>'b',c=>[qw/1 2 3/]}
---
a: b
c:
  - 1
  - 2
  - 3
                              
                                 構造体もdumpして表示できるので、perlshより便利げ。