in reply to Re^4: Summing the odd/even digits of a larger number (for upc check digits)...a better way?
in thread Summing the odd/even digits of a larger number (for upc check digits)...a better way?

You are right that undef is not being returned. False is being returned. False is a dual var. It's 0 when used in numerical context, and '' when used in string context. That's not quite the same as '', as the following shows:

use warnings; my $false = !1; my $nulstr = ''; print("'$false'\n"); # '' print("'$nulstr'\n"); # '' print(0+$false, "\n"); # 0 print(0+$nulstr, "\n"); # 0 with 'Argument "" isn't numeric'
  • Comment on Re^5: Summing the odd/even digits of a larger number (for upc check digits)...a better way?
  • Select or Download Code