2017-09-05 45 views
-1

運行在Mac OSX下面的腳本時,我收到錯誤MacOSX上運行Perl腳本時「無法找到EOF前字符串結束'?

Can't find string terminator '"' anywhere before EOF 

。注意這個腳本是從直接複製在Mac論壇...

#!/usr/bin/perl 
print "Hi there!\n」 
+1

你錯誤地關閉的字符串。您使用'''而不是''' –

+1

請注意,如果您要繼續使用UTF-8對源代碼進行編碼,則需要添加'use utf8;'。 – ikegami

回答

2

的雙引號字符串字面出發,在第二行的第七位置不會終止,因爲你用代替"當你試圖結束字面。

更換

print "Hi there!\n」 

print "Hi there!\n" 
相關問題