You have to insert characters. Think about what that entails in terms of manipulating the file image on the hard disk. Every character after the inserted character has to be moved.
There are modules like Tie::File which hide the details from you and expend a great amount of effort to make the process efficient, but at the end of the day every character in the file after the first character that is inserted has to be rewritten.
In reply to Re^3: Perl script to comment out lines in named.con file
by GrandFather
in thread Perl script to comment out lines in named.conf file
by firewall00
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |