Because null/undef isn't a number. atoi (the C library call) doesn't indicate any kind of error, so the caller can't tell the difference between a string containing "0" and a string containing "balloons". Both make atoi return the int 0, and that's what Perl does (though I think it uses floating point by default; same idea, though).
—John