develooper Front page | perl.perl6.language | Postings from July 2006

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

Thread Previous | Thread Next
Yuval Kogman
July 14, 2006 05:56
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
Message ID:
On Fri, Jul 14, 2006 at 11:42:24 +0100, Smylers wrote:

> I'm afraid I still don't get it.
> Or rather, while I can manage to read an explanation of what one of
> these operators does and see how it applies to the variables in the
> examples next to it, I am struggling to retain a feeling of _why_ I
> would want to use any of these operators in real-life Perl 6 code.

To compare deep structures ;-)

> Already in Perl 5 having 2 different equality operators is something
> that learners often stumble over.

But only for low level types. To see if two objects are the same, or
two hashes, you need to use Data::Compare, or to overload either ==
or eq, neither of which is a perfect fit.

I have to catch my flight, so I'll explain more later.

  Yuval Kogman <>  0xEBD27418

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About