10/04/23 16:55:03
>>232
別物みたいだけど?
package main;
my $c1 = new TestC;
my $c2 = new TestC;
warn '$c1->{a} and $c1->{a}: ' . is_equal($c1->{a}, $c1->{a});
warn '$c1->{a} and $c2->{a}: ' . is_equal($c1->{a}, $c2->{a});
sub is_equal {
my($x, $y) = @_;
($x eq $y) ? 1 : 0;
}
package TestC;
sub new{
my $class = shift;
my $self = {
a => [],
};
return bless $self, $class;
}
1;
====================
$c1->{a} and $c1->{a}: 1
$c1->{a} and $c2->{a}: 0