in reply to Command Switch -i prints to screen not file

By using <ARGV> in list context, you read not only all of the first file, but all subsequent files as well. The file to which you want to write has already been closed and you've already moved on to the next file by the time you reach the print

Read one file at a time:

local $/; # One line = one file while (<>) { my @input = split /^/m; if (!grep {/Friday/} @input) { splice @input, 1, 0, "Friday\n"; } print @input; }