[問題] purl學習手冊第九章最後

看板Perl作者 (饅頭)時間14年前 (2011/04/11 19:52), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/1
為什麼我照著課本上在命令列打上 perl -p -i -w -e 'say andy' perl_00.txt 會出現如下error Can't find string terminator "'" anywhere before EOF at -e line 1. 已確定有perl_00.txt這個檔。 可是確沒有印出"andy\n" 剛才也試了 perl -p -i.bak -w -e "say andy" perl_00.txt 這次雖沒有出現error可是也還是沒有印出"andy\n" 有誰知道為什麼嗎? 我的perl是最新的5.12.3版. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.144.77 ※ 編輯: jjandy 來自: 140.113.144.77 (04/11 20:15)

04/20 21:06, , 1F
perl -E "say 'andy'" # say 是新的關鍵字,要用 -E
04/20 21:06, 1F

04/20 23:49, , 2F
推推推 原來是這樣用!!!
04/20 23:49, 2F
文章代碼(AID): #1DekkBOp (Perl)
文章代碼(AID): #1DekkBOp (Perl)