in reply to Re^2: Subroutine Question
in thread Subroutine Question

Could it be that perhaps $sum was bigger than 9? If so, there is nothing in the hash to find and you get an undef value returned.

Have a look at Lingua::Any::Numbers. It can convert numbers to strings.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^4: Subroutine Question
by frozenwithjoy (Priest) on Jun 27, 2012 at 06:20 UTC
    And multiple language support?! That's hot!
      Task::Lingua::Any::Numbers will install all the existing language modules for you. Presently these are are: ID, BASE, NL, NO, PT, TR, EU, DE, BG, JA, AF, SV, IT, PL, CS, ES, FR and EN.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics