Skip to content

Instantly share code, notes, and snippets.

@djmitche
Created January 8, 2010 04:40
Show Gist options
  • Select an option

  • Save djmitche/271855 to your computer and use it in GitHub Desktop.

Select an option

Save djmitche/271855 to your computer and use it in GitHub Desktop.
my $obj1 = MyClass->new();
my $obj2 = MyClass->new();
my $someobj = $obj1;
not_ok($obj1 eq $obj2);
ok($obj1 eq $someobj);
# equality means identity here: if $oneobj eq $anotherobj,
# then after $oneobj->set_foo(10), $anotherobj->get_foo() returns 10
# in python, this is the "is" operator. What's the Perl equivalent?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment