Hello All,

I am unable to find out why is this not matching:

I do have a file where the second line contains:

 Summary Log (generated: Tue Apr  1 22:02:29 MST 2003)

I am processing this file by this script:

#!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 (<IO> ) {
      chop;
      (my$FH, my$output, my$file2check, my$month, my$year) = split
(/\s+/, $_);

open OUT, ">> $output";

chdir $FH or die "$!";

while (glob $file2check) {
    print "Processing $file2check";
    open FH, $_ or die $!;
    flock FH, LOCK_SH or die $!;
    while (<FH> ) {
        chomp;
        if ( / Summary Log (generated:/ ) {
        my($summary, $log, $generated, $day_word, $m,
$day_number,$time,$timezone, $year ) = split(/\s+/, $_);
       # $impressions += $value if ($value =~ /\d+/);
        print "File $file2check is $month, $year\n";

           }
         }
    close FH or die $!;
      }
    }
# print OUT 'Total impressions: ', $impressions or die $!;
print $output, $file2check, $month, $year

Where I am checking if there is a line Summary log by   "if ( / Summary
Log (generated:/ ) {"

And I am receiving this error:

Unmatched ( in regex; marked by <-- HERE in m/ Summary Log ( <-- HERE
genereated:/ at c07_imp.pl line 25.

Does anybody know why?

Thank you for your time.

danield


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to