|
[PHP]@char = ("區eo1","區ngeo1","區kwu1","別bid3","別bid6");
$wordchar1 = "區";
$wordchar2 = "別";
@n1 = grep (/$wordchar1/, @char);
@n2 = grep (/$wordchar2/, @char);
print @n1;
print @n2;[/PHP]
執行此腳本,發現 @n1 為空(此時@n1本應該為 ("區eo1","區ngeo1","區kwu1") 的),@n2 正常得到("別bid3","別bid6")。
真是奇怪了,不知道什麼原因。
我的perl版本是 ActivePerl-5.8.8.817-MSWin32-x86-257965 |
|