in reply to if condition
Here's the condition you're talking about:
if ((scalar @$ort_log[$site_index])==scalar '+')
The cause of your problem is that you're using "==" to compare strings, but it's only useful for comparing numbers. You need to compare with "eq" instead. With "==", you're comparing numeric values, which are both zero.
Note also that scalar '+' is the same as '+'. It might also be good to write "@$ort_log[$site_index]" as "${$ort_log}[$site_index]" or "$ort_log->[$site_index]" to make it clear that $ort_log is an array reference. Your comparison would be better written:
if ( '+' eq $ort_log->[$site_index] )
Hope this helps.
|
|---|