On Tue, Oct 23, 2001 at 08:08:27AM +1000, Damian Conway wrote:
> 
>    > > 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.

I guess I still wonder how this will work. I suppose pp_numerify will
have this logic, and then call SvNV or whatever. It just feels to me
like you're creating a conceptual infinite loop.

I need to stop thinking of +$x and $x+0 as the same thing... but
it's hard (hmmm... math is hard... I've heard that somewhere ;-).

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to