in reply to Re: Simple add and multiply subroutines
in thread Simple add and multiply subroutines

Dispatch table - yes, string eval - OMG NO! especially not for a beginner!

Your grep test for "Non-numeric input" won't accept floating point numbers or negative numbers.

  • Comment on Re^2: Simple add and multiply subroutines

Replies are listed 'Best First'.
Re^3: Simple add and multiply subroutines
by oko1 (Deacon) on Apr 08, 2008 at 20:05 UTC

    Nor engineering notation, nor imaginary numbers, nor Roman numerals either. It will, however, handle the integers as shown in the original request. :)

    String eval... OK, you're right. Easy enough to fix, and I see (behind the cut tags) that the poster just before me already did that.

    
    -- 
    Human history becomes more and more a race between education and catastrophe. -- HG Wells