The warn at line 20 in my program prints <M> on its last 2 invocations, but not its first... why did this happen. Here is my program:[tbone@horse1 200716-007]$ perl ../delivered-list.pl > delivered-list. +dat UNIX at ../delivered-list.pl line 12. WIN32 at ../delivered-list.pl line 16. IMP_6.rpt at ../delivered-list.pl line 20. Syn5.rpt at ../delivered-list.pl line 20, <M> line 8554. SynOne.rpt at ../delivered-list.pl line 20, <M> line 40689. [tbone@horse1 200716-007]$
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 (<M>) { last if /^\s*$/; # the line before X rows affected my ($id, $email) = split; StripTSpace($email); print "$id\t$email\n"; } }
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality
In reply to A slight variation in warn output... why? by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |