Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Numification of strings

by ikegami (Pope)
on Aug 02, 2010 at 03:36 UTC ( #852393=note: print w/replies, xml ) Need Help??


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 (Bishop) 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. ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://852393]
help
Chatterbox?
[Corion]: Hehe - $work is a place where we have lots of (money) accounts, and lots of journals where every transaction is recorded. But our HR system where the accounts of hours worked and vacation days taken are stored, there is no real account of who changed ...
[Corion]: ... that balance, and when. And it seems to me that they somehow really messed up the database since the start of the year and have been frantically adding and subtracting numbers from the totals, but without trace ;)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2018-01-23 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (249 votes). Check out past polls.

    Notices?