Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

(CL) Re^2: eq or == with references

by CheeseLord (Deacon)
on Jul 08, 2001 at 05:50 UTC ( [id://94793]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-03-28 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found