$ cat 659032.pl #!/usr/bin/perl -w use warnings; use strict; # Open in Read/Write mode and modify it in place open FH, "+<", "a_file.txt" or die "Can't open file!"; print FH "Foo bar baz!"; close FH; $ cat a_file.txt Now is the time for all good men to come to the aid of their party. $ perl 659032.pl $ cat a_file.txt Foo bar baz!ime for all good men to come to the aid of their party. $