Perlについての質問箱 43箱目at TECH
Perlについての質問箱 43箱目 - 暇つぶし2ch234:デフォルトの名無しさん
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


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch