Robincui has asked for the wisdom of the Perl Monks concerning the following question:
I print three value: name: Uptime, last_value: 816078, now_value: 816125, value_var: -47 the true result should be 47, but i get -47. I can solve the problem with:xml file: <global_status> ...... <status name="Uptime" value="816078" value_var="30"/> </global_status> code: my $now_value = scalar($_->[1]); my $last_value = $last_status_data->{value}; $value_var = $now_value - $last_value;
but i want to know why the negative result is generated? Thanks a lot! Robinmy $last_value = $last_status_data->{value}+0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why the subtract result is negative when i use XML::Smart!
by tye (Sage) on Aug 20, 2007 at 04:23 UTC | |
|
Re: why the subtract result is negative when i use XML::Smart!
by GrandFather (Saint) on Aug 20, 2007 at 03:59 UTC | |
by Robincui (Initiate) on Aug 20, 2007 at 07:04 UTC | |
by GrandFather (Saint) on Aug 20, 2007 at 09:22 UTC |