論理和演算子クイズ



#! /usr/local/bin/perl

$word = "bar";
if ( $word eq ("foo" || "bar")) {
print "Match.\n"; # (1)
} else {
print "No Match.\n"; # (2)
}

実行されるのは(1)と(2)の行、さあどっち?

Posted: 木 - 1月 22, 2004 at 12:27 午前        


©