以下の内容はhttps://r9.hateblo.jp/entry/20120409/p1より取得しました。


"package"の代わりに"class"を使うclass.pm作った

再発明かな。

use strict;
use warnings;
use class;

class "Foo" => (
    bar => sub {
        my $self = shift;
        if (@_) {
            $self->{bar} = shift; 
        }
        $self->{bar};
    },
);

my $foo = Foo->new(bar => 'baz');
print $foo->bar, "\n";
#=> 'baz'
$foo->bar('hoge');
print $foo->bar, "\n";
#=> 'hoge'



以上の内容はhttps://r9.hateblo.jp/entry/20120409/p1より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14