in reply to if logic OR parentheses problem

Try adding
use strict; use warnings;

at the top of your program. They'll point out many errors in your program.

Update:

$atob is -2.5
$btoc is -0.5
$atoc is -3

That's why the first elsif isn't executed: $btoc > 1 || $btoc < -1 is false.

Replies are listed 'Best First'.
Re^2: if logic OR parentheses problem
by Ellhar (Novice) on Oct 26, 2007 at 15:54 UTC
    my god I'd commented out some stuff at the top of my program as I was having trouble automating excel. And I'd done strict and warnings!!!!! I hang my head in shame and apologies for the waste of your time. Thanks to all who replied E