[Moved parent from CUFP to SoPW. Perl questions are to be posted in SoPW.]
The command (including $$) is being parsed and interpreted by the shell. If you want Perl to interpret $$, it needs to be in the Perl code. Fortunately, inplace editing (-i) can be initiated from within a script.
perl -pe 'BEGIN { $^I = ".$$" } s/search/replace/g' *.html
Ref: $^I
In reply to Re: Backup filename extension with -i option
by ikegami
in thread Backup filename extension with -i option
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |