Perl运算符eqv不起作用

问题描述 投票:-1回答:1

下面的代码不起作用,但我不知道为什么。

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

我正在使用Perl v5.14。而且“ eqv”和“ ==”之间有什么区别?

perl operator-keyword equality
1个回答
4
投票

[Perl5中没有像eqv这样的运算符。我认为您正在寻找eq运算符。

要查看eq==运算符之间的区别,请参见:

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

eq vs. ==

阅读此以获得更多信息:

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

Comparison of the Perl equality operators

© www.soinside.com 2019 - 2024. All rights reserved.