-1

Below code is not working but I don't know why.

my $q = (1, 2) eqv (1, 3);
print "$q \n";

I'm using Perl v5.14. And also what is the difference between "eqv" and "==" ?

Elizabeth Mattijsen
  • 25,654
  • 3
  • 75
  • 105
sam
  • 73
  • 7
  • 1
    "eqv" is a new operator in perl6. – sam Apr 27 '15 at 07:42
  • 1
    cf [Data::Compare](https://metacpan.org/pod/Data::Compare) – Christoph Apr 27 '15 at 09:40
  • 1
    Perl 5 and Perl 6 are both great languages, but they are different languages. If you want to learn one or the other or both, please be sure you know which is being referred to in the tutorials, web pages, or answers that you read. – Christopher Bottoms May 05 '15 at 20:15
  • When writing Perl 5 programs always start them with `use strict` and `use warnings` until you know exactly why they are recommended. – Brad Gilbert Jul 29 '15 at 00:51

1 Answers1

4

There is no operator like eqv in Perl5. I think you are looking for eq operator.

To see the difference between eq and == operator, see this:

perl string compare with “eq” vs “==”

eq vs. ==

Read this for more information:

What's the deal with all the different Perl 6 equality operators

Comparison of the Perl equality operators

Community
  • 1
  • 1
serenesat
  • 4,611
  • 10
  • 37
  • 53