in reply to (ar0n) Re: eq or == with references
in thread eq or == with references

I think eq will work, but according to this, so would ==...

my %one = ('a' => 'b'); my %two = ('b' => 'a'); my $ref1 = \%one; my $ref2 = \%two; if ($ref1 == $ref2) { print "Equal.\n" } else { print "Not equal.\n" } $ref2 = $ref1; if ($ref1 == $ref2) { print "Equal.\n" } else { print "Not equal.\n" }

prints out

Not equal. Equal.

for me, which seems to say that == will work. Of course, I'm likely overlooking a not-so-trivial point, as I just hacked that little test together...

His Royal Cheeziness