ratboy has asked for the wisdom of the Perl Monks concerning the following question:
When I run this code and it finds the last type of report, the program hangs until I hit enter for each report of this type. I would like for it NOT to do this. What sort of goofy logic error have I committed here?
foreach $xreport (@list) { # code to check to see which subroutine is needed if ($xreport =~ m/XSAColorQube/) { $count++; &Qube; } elsif ($xreport =~ m/XSAcolor/) { $count++; &Color; } elsif ($xreport =~ m/XSAreport/) { $count++; # some have fax, some do not, reports differ, checking open(XRPT,"<$xreport") or die "Cannot open $xreport: $ +!\n"; $line = readline(*STDIN); close(XRPT); if ($line =~ m/EFax/) { &Regular; } else { &NoFax; } } else { print "$xreport does not match expected naming scheme +and was not processed.\n"; } } print "-------------------------------------------\n"; print "Processed $count files.\n"; print "Output combined into report myxrxrpt.csv.\n"; close(OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pausing on extra IF
by choroba (Cardinal) on Sep 30, 2011 at 15:50 UTC | |
by ratboy (Initiate) on Sep 30, 2011 at 20:18 UTC |