#!usr/bin/perl -w #use strict; use Fcntl qw[:flock]; my $impressions = 0; my $iofile = '/other/scripts/daniel/input/c07_impressions_io.info'; open (IO, $iofile) || die("Could not open file 1!"); while () { chop; my ($FH, $output, $file2check, $month, $year) = split (/\s+/, $_); open OUT, ">> $output"; chdir $FH or die "$!"; while (glob $file2check) { open FH, $_ or die $!; flock FH, LOCK_SH or die $!; while () { chomp; if ( / Summary Log \(generated:/ ) { print "Found Sumary Log, checking the month and year.\n"; my($emptyspce, $summary, $log, $generated, $day_word, $monthfile, $day_number, $time, $timezone, $yearfile) = split(/\s+/, $_); print "The current file has $monthfile and $yearfile\n"; print "And I am looging for $month and $year\n"; if ( $monthfile eq $month and $yearfile eq $year){ print "File has $yearfile and $monthfile in it. Now Looking for Impressions.\n"; my $found = 0; until ($found) { my $line = ; if ($line =~ /Impressions:/ ) { $found++; print "Found Impressions, now splitting.\n"; my($text, $value) = split(/:\s*/, $_); print $impressions += $value if ($value =~ /\d+/); print "\n"; } } } } } close FH or die $!; } } print OUT 'Total impressions: ', $impressions or die $!; #### Found Impressions, now splitting. Argument "Sat Nov 1 00" isn't numeric in add at c07c_imp.pl line 39, chunk 13. 0 Found Sumary Log, checking the month and year. The current file has Nov and 2003) And I am looging for Nov and 2003) File has 2003) and Nov in it. Now Looking for Impressions. Found Impressions, now splitting. Argument "Sat Nov 1 00" isn't numeric in add at c07c_imp.pl line 39, chunk 13. 0 Found Sumary Log, checking the month and year. The current file has Nov and 2003) And I am looging for Nov and 2003) File has 2003) and Nov in it. Now Looking for Impressions. Found Impressions, now splitting. Argument "Sat Nov 1 00" isn't numeric in add at c07c_imp.pl line 39, chunk 13.