Perlではメソッドのオーバーロードが出来ない様ですね。まぁこんなだけ変数の型にゆるゆるだったら、出来るわけもないのかと思ったりもしますが、、、 代替策としてこんなのがあるみたい。 私としては、まとまってていいなーって感じです。 package Triangle; use Carp qw(croak); my $subSpace = sub { my($a,$b,$c) = @_; my $s = ($a + $b + $c) / 2; my $inRoot = $s * ($s - $a) * ($s - $b) * ($s - $c); if ($inRoot >= 0){ return sqrt($inRoot); }else{ croak "you cannot construct the triangle with the sides $a, $b, $c !"; } }; su