Save that and run thescript.pl *.html or find . -iname \*html | xargs thescript.pl That will do the dirty work, but it wont print out the file names for changed files. As for your original script, I don't see where you are printing out the changed lines.#!/usr/bin/perl -w -i.bak -p s/<!--#include virtual="(.*)"-->/<?php include(\$_SERVER[\'DOCUMENT_RO +OT\'].\'$1'); ?>/g;
In reply to Re: modify file in place with perl -i
by Anonymous Monk
in thread modify file in place in script? Regex for changing includes from SSI to PHP
by hmbscully
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |