in reply to Debug basic calculator syntax

You should always use
use strict; use warnings;
It would have shown you immediately you have a problem with:
if ($add = "y") and if ($mult = "y")

Rather than using '=' it should be '=='.

TheStudent

Replies are listed 'Best First'.
Re^2: Debug basic calculator syntax
by CountZero (Bishop) on Jun 23, 2005 at 21:16 UTC
    ++ for advising to use strict and warnings; -- for saying to use '==' for string comparisons (it should be 'eq').

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      I jumped to reply without thinking. The warnings from perl said:
      Found = in conditional, should be == at calc.pl Found = in conditional, should be == at calc.pl

      TheStudent

Re^2: Debug basic calculator syntax
by !1 (Hermit) on Jun 23, 2005 at 21:25 UTC

    I believe you mean, "Rather than using '=' it should be 'eq'."