in reply to Returning Values from Subroutines

Your add() function stores the sum in $result, but you're trying to return $answer. Replace return $answer with return $result in add(), and you'll be fine.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;