//: it will give the defined value to the variable, even if the value is 0.
- use 5.010;
-
-
foreach my $r (0, undef, '0', 9, "that"){
-
print "the is $r\n";
-
$s = $r // 'default';
-
print "$s\n";
-
}
-
-
-
the is 0
-
0
-
the is
-
default
-
the is 0
-
0
-
the is 9
-
9
-
the is that
-
that
阅读(287) | 评论(0) | 转发(0) |