我是Perl的新手。現在我試圖用Perl來替換xml文件中的某些內容。下面的代碼是我的命令Perl用xml文件替換一些內容
perl -pi -e "s/<Connector port=\"\d+\" protocol=\"HTTP/1.1\" /<Connector port=\"${ACCESS_PORT}\" protocol=\"HTTP/1.1\" /g" $TOMCAT_SERVER_CONF
但給人的perl這個抱怨:
Bareword found where operator expected at -e line 1, near ""34233" protocol"
(Missing operator before protocol?)
Can't modify numeric lt (<) in scalar assignment at -e line 1, near ""34233" protocol"
syntax error at -e line 1, near ""34233" protocol"
Execution of -e aborted due to compilation errors.
任何人都可以幫忙嗎?將非常感激它。
非常感謝!有用。 – spark1631