use Math::RPN; my $answer=rpn(0.MOD); if (!defined($answer)){ print "SERVFAIL"; }else{ print "Answer: ". $answer."\n"; }