08/01/12 23:23:55
>>13
そか? むしろOOってこんなに簡単だったんだ、とオモタが。
[Hoge.pm]
package Hoge;
sub new {
my $class = shift;
return bless({@_}, $class);
}
sub fuga {
my ($self, $world) = @_;
print "$self->{hello}, $world\n";
}
1;
[hoge.pl]
use Hoge;
my $h = new Hoge(hello => "HELLO");
$h->fuga("WORLD");