http://www.perlmonks.org?node_id=1013409


in reply to writing an api wrapper I get a 1 with my return value from method

The last statement in your getAll routine is print "All Answers";. A subroutine returns without explicit return "automatically returns the value of the last expression evaluated." print "[r]eturns true if successful", so getAll returns 1.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: writing an api wrapper I get a 1 with my return value from method
by gideondsouza (Pilgrim) on Jan 15, 2013 at 15:21 UTC

    Ah man! I had a feeling it was something silly :( I'm a little embarrassed

    Oh well, you live and learn!

    Thanks very much for you reply kennethk