Here's most of the code for the problem I'm talking about:
@logs = <@ARGV>; %reports=(); %results=(); open (INPUT_IN, "FindSitesInput.txt")|| die "Can't open input file! :$ +!"; while (defined($currentLine = <INPUT_IN>)) { $_=$currentLine; if(! m/^\#/) { #split currentLine into tab-delimited tokens @tokens = split("\t",$currentLine); my @temp = ($tokens[1], $tokens[2], $tokens[3], $tokens[4]); $reports{$tokens[0]}=\@temp; my @data=(); $results{$tokens[0]}=\@data; } } } close (INPUT_IN) || die "Can't close input file: $!"; #now run the reports on each log file foreach $logfile(@logs) { open (LOG_IN, "$logfile")|| die "Can't open $logfile! :$!"; while (defined($currentLine = <LOG_IN>)) { @tokens = split(" ",$currentLine); foreach $rep (keys %reports) { @comparisons = split(" ", $reports{$rep}[0]); foreach $item (@comparisons) { if($reports{$rep}[2] == "site") { $_=$tokens[6]; if(/$item/) { push @{$results{$rep}}, $currentLine; } } elsif ($reports{$rep}[2] == "ip") { $_=$tokens[2]; if(/$item/) { push @{$results{$rep}}, $currentLine; } } } } } close (LOG_IN) || die "Can't close log file: $!"; #now write the output files for each report for this log foreach $rep (keys %results) { open (OUTPUT, ">$logfile-$rep")|| die "Can't open $logfile-$re +p! :$!"; print OUTPUT @{$results{$rep}}; if(close OUTPUT) { if(!($reports{$rep}[2]eq"none")) { system("c:\\blat\\blat $logfile-$rep -t \"$reports{$re +p}[2]\""); } } else { die "Can't close output file: $!"; } } }
The input values are read from a file (I've tested to verify that the data structure is created properly).

In reply to Re: Waiting for file creation by Anonymous Monk
in thread Waiting for file creation by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.