use diagnostics; use String::Strip; my @unix_file = 'churn-list.dat'; my @ms_file = <*.rpt>; warn "UNIX"; `cat $_` for (@unix_file); warn "WIN32"; for (@ms_file) { warn $_; proc_ms($_); } sub proc_ms { my $file = shift; open (M, "tail +3 $_ |") or die $!; while () { last if /^\s*$/; # the line before X rows affected my ($id, $email) = split; StripTSpace($email); print "$id\t$email\n"; } }