Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The use of the 'eq' operator, or the '=~', will force the lvalue into scalar context. Your array, as a scalar, is interpretted to be the length of the array at the time of reference. You are comparing "1" to ".". You likely intend one of the following: @{$Circ->[$i][$j]} == 1 && $Circ->[$i][$j][0] eq '.'or, "@{$Circ->[$i][$j]}" eq '.'Note, in the latter case, that the array is being interpolated within a string. This code is equivalent to: join($,, @{$Circ->[$i][$j]}) eq '.'For simplicitly, I would choose to use a temporary variable:
Cheers, In reply to Re: Array equality woes
by MarkM
|
|