#! /usr/bin/perl -i.bak while (<>) { # Insert header line if ($ARGV ne $oldargv) { $ARGV =~ /\d+/; $filenum = $&; print <