소스 검색

perl: tweak the -0 example

Waldir Pimenta 7 년 전
부모
커밋
efbf0cc51e
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      pages/common/perl.md

+ 4 - 4
pages/common/perl.md

@@ -22,10 +22,10 @@
 
 `perl -p -i -e 's/{{find}}/{{replace}}/g' {{filename}}`
 
-- Run a multi-line find/replace expression on a file (i.e. including line breaks):
-
-`perl -0 -p -i -e 's/{{foo\nbar}}/{{foobar}}/g' {{filename}}`
-
 - Run a find/replace expression on a file, saving the original file with a given extension:
 
 `perl -p -i'.old' -e 's/{{find}}/{{replace}}/g' {{filename}}`
+
+- Run a multi-line find/replace expression on a file, and save the result in another file:
+
+`perl -p0e 's/{{foo\nbar}}/{{foobar}}/g' {{input_file}} > {{output_file}}`