in reply to Re^2: Use of uninitialized value in string eq
in thread Use of uninitialized value in string eq
Any idea concerning the use of 'eq' operator?
ikegami has already given you the answer to that. Your line
my @temp = $info{$humangi};
assigns a single scalar value to element zero only of the @temp array and no other element is initialised, but your line
my ($source, $position, $sink) = split(/(\d+)(\w)/, $Variant);
assigns the value of 82 to $position using your example of "P82L" in $Variant. Your comparison
if ( $temp[$position] eq $source) {
attempts to access element 82 of @temp which does not exist, hence the warning.
I hope this clarifies things for you.
Cheers,
JohnGG
|
|---|