简体   繁体   English

Perl 运算符 eqv 不起作用

[英]Perl operator eqv is not working

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.我正在使用 Perl v5.14。 And also what is the difference between "eqv" and "==" ?还有 "eqv" 和 "==" 之间有什么区别?

There is no operator like eqv in Perl5. Perl5 中没有像eqv这样的运算符。 I think you are looking for eq operator.我认为您正在寻找eq运算符。

To see the difference between eq and == operator, see this:要查看eq==运算符之间的区别,请参阅:

perl string compare with “eq” vs “==” perl 字符串与“eq”和“==”进行比较

eq vs. ==等式与 ==

Read this for more information:阅读本文了解更多信息:

What's the deal with all the different Perl 6 equality operators与所有不同的 Perl 6 相等运算符有什么关系

Comparison of the Perl equality operators Perl 相等运算符的比较

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM