Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: When numeric conversion overloading goes awry.

by dragonchild (Archbishop)
on Jan 24, 2006 at 19:34 UTC ( #525297=note: print w/ replies, xml ) Need Help??


in reply to When numeric conversion overloading goes awry.

Submit the following patch to the maintainer of Error.pm:

-exists $self->{'-value'} ? $self->{'-value'} : undef; +exists $self->{'-value'} ? $self->{'-value'} : 0;
The bug is that 0+ should always return something that is a number. Undef, as you've discovered, isn't a number.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?


Comment on Re: When numeric conversion overloading goes awry.
Download Code
Re^2: When numeric conversion overloading goes awry.
by dmitri (Curate) on Jan 25, 2006 at 16:25 UTC
    That will technically work. Semantically, however, this may lead to problems -- I think SOAP::Serializer relies on this technique to generate unique IDs for objects. If there are two such Error objects, SOAP::Serializer may get confused. I will file a bug in Error.pm's CPAN page, however, as yours is a valid point.
      Then that's a bug in Soap::Serializer. UIDs are a well-studied space with UUID and Data::UUID simply being two modules I've personally used. That should be filed, as well.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://525297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-04-20 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls