0
use Class::Struct;
struct (TimingStruct => {
_timingSense => '$',
_timingType => '$',
_relatedPin => '$',
_whenCond => '$'
});
struct (OutPinStruct => {
_outPinName => '$',
_outFunction => '$',
_timingarray => '@', #_timingarc => 'TimingStruct'
});
my @tarray =();
my $t;
$t = TimingStruct->new(_timingSense => 'Unate',
_timingType => 'Wave',
_relatedPin => 'CO',
_whenCond => 'A^B'
);
push(@tarray, $t);
$t = TimingStruct->new(_timingSense => 'Combinational',
_timingType => 'Rising',
_relatedPin => 'ICO',
_whenCond => 'A^B^CI'
);
push(@tarray, $t);
my $op = OutPinStruct->new(_outPinName => "CO",
_outFunction => "A^B^CI",
_timingarray => \@tarray);
print $op->_outPinName . "\n";
print $op->_outFunction . "\n";
print $op->_timingarray . "\n";
my $t = ${${$op->_timingarray}[0]}[0];
print "\$t = \$op->_timingarray = $t->_timingSense() \n";
my @t = {$op->_timingarray};
print "\@t = \@{\$op->_timingarray} = $$t[1] \n";
每個輸出引腳可以有許多定時弧,OutPinStruct有一個數組來保存定時弧。我不確定取消引用數組(_timingarray)有人可以告訴我,我做錯了什麼?Perl - Class :: Struct Deferencing array
謝謝。
您能更具體地瞭解發生了什麼問題嗎? – Ether 2010-07-30 16:10:02