> > To check for numericity of input, you'll write: > > > > $number = +<$fh> > > until defined $number; > > > > If you ignore the definedness, the C<undef> will just promote to zero > > in numeric contexts. > > I'm confused. By the time $number sees the line from the filehandle, > it's already been nummified to 0.
No. I'm saying that if you give unary C<+> a string that can't be interpreted as a number, unary C<+> gives you back C<undef>. So on "bad" input, $number gets C<undef> and the loop repeats. Damian