[Perl] make changes form line 3 to line 20

How to substitute all pattern1 to pattern2 from the 3rd line to the 20st line?
Perl has the solution... and in one line :D

[pene@donunix] perl -p -i -e "s|pattern1|pattern2| if 3 .. 20" file.txt

No comments: