If you run that on its own then I would expect you will get no output at all because you don't print anything anywhere inside the loop. Perhaps what you want is:
while (<>){ if (/^#!/){ $_ .= "Add this line.\n"; } print; }
In reply to Re: To add a string to the content of a file
by GrandFather
in thread To add a string to the content of a file
by Babambar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |