Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: A simple Comparison

by btrott (Parson)
on Jun 30, 2000 at 21:11 UTC ( #20628=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
        my $obj1 = new Obj;
        my $obj2 = new Obj;
        if (freeze($obj1) eq freeze($obj2)) {
            ## They're the same.
  2. or download this
        package Obj;
        use Storable qw/freeze/;
        use overload '==' => \&compare;
        sub compare { return freeze($_[0]) eq freeze($_[1]) }
  3. or download this
        if ($obj1 == $obj2) {
            # They're the same.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://20628]
[Corion]: Meh, first round of escalations for me not wanting to fix in production what a project has mismanaged. Now another project, which eats up all the resources until end of this year wants to take that task and put it on my list of things as well.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2017-08-17 12:18 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (287 votes). Check out past polls.