{ local @ARGV = @FILES; local $^I = '.orig'; my %seen; while (<>) { (s/$/\tFilename/, (print), next) unless $seen{$ARGV}++; s/$/\t$ARGV/; print; } }