http://www.perlmonks.org?node_id=852393


in reply to Numification of strings

When you ask for the numeric value of something that isn't a number, it does the best it can and gives a warning.

Replies are listed 'Best First'.
Re^2: Numification of strings
by LanX (Saint) on Aug 02, 2010 at 11:43 UTC
    ... and gives a warning.

    ah, thank you!

    I missed there are warnings while testing in the debugger¹!

    However this gives me the possibility to change $SIG{__WARN__} to deal with this kind of errors...e.g. by dieing.

    Cheers Rolf

    1)... hmm but why?

    UPDATE:

    OK starting the debugger with -w switch helps.

    :~$ perl -w -de0 ... DB<1> $x="6gg" DB<2> p -$x Argument "6gg" isn't numeric in negation (-) at (eval 6)[/usr/share/pe +rl/5.10/perl5db.pl:638] line 2. ...