[Perl] ファイル内の文字列を一括置換するには

  • 対象ファイル:*.html
  • 置換対象文字列:before
  • 置換後文字列:after
  • 元ファイルのバックアップ:*.html.bak

$ perl -p -i.bak -e 's/before/after/g' *.html