autobox-Core はPerl用のモジュールです。このモジュールは意外と使われていないかもしれませんが、便利なモジュールの一つです。スクリプト言語の魅力の一つは、気軽にコーディングして実行、結果を得るところにあります。場合によっては話しつつコーディングし、結果を見せるという場面もあるでしょう。そんな時に利用して欲しいツールになります。巷では、ライブコーディングやライブコーディング飲み会などといったことも流行っているようなので、ぜひお試し下さい。

autobox-Core の主な特徴について

1) 直感的で思考通りのコーディング

次のようなコードがあるとします。

print join(" ", reverse(split(" ", $string)));

これが、次のようにコーディングできます。

use autobox::Core;
$string->split(" ")->reverse->print;

2) メソッドが豊富

次の通り、豊富なメソッドがそろっています。

String Methods
    concat
    strip
    trim
    ...

I/O Methods
    print
    say

Boolean Methods
    and
    not
    or
    xor

Number Related Methods
    dec
    inc
    mod
    ...

Reference Related Methods

Array Methods
    vdelete
    uniq
    first
    max
    ...

Hash Methods
    at, get
    put
    set
    each
    ...

Code Methods
    curry 
    ...

autobox-Core のインストール

sudo cpanm autobox::Core でインストールできます。

近年のコーディングスタイルは、好む方、好まない方がいると思います。コメントに沿ったコーディングを行う時に autobox-Core 使ってみると、その通りに書けて快適です。流行りだけでなく、場面ごとに選択をして利用すると良いのではないでしょうか。

autobox-CoreはPerl製、GPLとArtistic Licenseのオープンソース・ソフトウェアです。

autobox::Core - Provide core functions to autoboxed scalars, arrays and hashes.

source code