本文共 1062 字,大约阅读时间需要 3 分钟。
Perl???????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????
my $x = 2;my @array = (1, 2, 3);my $flag = 0;for (@array) { if ($x == $_) { $flag = 1; }}if ($flag == 1) { print "$x is in the array;";} else { print "$x is not in the array;";}
?????????????????
my $x = 2;my @array;if (@array~~$x) { print "$x is in the array;";} else { print "$x is in the array;";}
???????????????????????????????
'hello'~~{hello => 1, world => 2}
??? true
?????????????
???????????Perl????????????????????????????
???????????????????????????
转载地址:http://bqwp.baihongyu.com/