peppiv has asked for the wisdom of the Perl Monks concerning the following question:
my $count3 = 0; my $cgi3 = "$urchinpath/bin/urchin.cgi"; $ENV{REQUEST_METHOD} = "GET"; if (defined $field{$report3}) { $ENV{QUERY_STRING} = "r=$report3&b=$begin&e=$end&v=$max&rid=$rid&la +ng=$language&f=$field{$report3}"; } else { $ENV{QUERY_STRING} = "r=$report3&b=$begin&e=$end&v=$max&rid=$rid&la +ng=$language&f=$tab"; } open (CGI, "$cgi3 |") or die "Failed to open urchin.cgi: $!"; while(<CGI>) { if ($_ =~ /^parent.dLoad\((.*)\);?\s*/) { @line = split(/,/, $1); if (($report3 != 1102) && ($report3 != 1901) && ($report3 != 190 +2) && ($report3 != 1905)) { $line[0] = (split(/"/, $line[0]))[1]; } if (!defined $line[0]) { $line[0] = ""; } $line[1] = &formatNumber($line[1]); if (($report3 == 1101)) { printf("%-66s %13s\n", $line[0], $line[1]); #Here's the bugger. This is the line that prints what I need +. } elsif (defined $field{$report3}) { printf("%-66s %13s\n", $line[0], $line[($field{$report3}+1)]) +; } $count3++; } } close(CGI) or die "Failed to close urchin.cgi: $!"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Consolidate info in a while() loop
by CountZero (Bishop) on Jan 21, 2003 at 19:38 UTC | |
by peppiv (Curate) on Jan 21, 2003 at 21:41 UTC | |
by poj (Abbot) on Jan 21, 2003 at 22:43 UTC | |
by peppiv (Curate) on Jan 22, 2003 at 13:38 UTC | |
by CountZero (Bishop) on Jan 21, 2003 at 22:17 UTC |