in reply to LOG FILE HELP IN PERL

You didn't show us what you expect to be printed. But, when I fix the compile errors in the code you posted, then run it, I get the following output:
./foo.log Use of uninitialized value $uid in join or string |61110530R_000001.jpg|8|fb0ff0b498cb6ce79df20fdddd71da3f|08141ce3c84cb +54d57d40b5023312c53 Use of uninitialized value $uid in join or string |61110530R_000002.jpg|8|7b44c390f7279a3f266652a96a5f686d|462db8d6b278f +6fdb63f87fd2974e7e9 Use of uninitialized value $uid in join or string |61110530R_000003.jpg|8|8acd6e39a21f0fc18dfb6a54663fa472|7e9c7959e3a3b +60c4d2f80e089f03f9d Use of uninitialized value $uid in join or string |61110530R_000004.jpg|8|f655a572365bcea7c878201b7606d68a|0fbdfb7ba703e +0ad810025135e4e8070 Use of uninitialized value $uid in join or string |61110530R_000005.jpg|8|2a055f3579db7f9c583c8cf84afdf030|50a8ee3e882b7 +9de5fe8a47be54cc478 Use of uninitialized value $uid in join or string |61110530R_000006.jpg|8|8dfa19092cdf0d76bf99eede88faee19|3380c9f79217b +a0faee294ab9cffdb81 Use of uninitialized value $uid in join or string |61110530R_000007.jpg|8|97d8a953cc1b8ab1dff728a8b08146be|37fa1505f9ca1 +3251406658653af4439 Use of uninitialized value $uid in join or string |61110530R_000008.jpg|8|638a7f3cb7d2b189751c62c91e018d28|d008d5852cfaf +f6cf14fa0748b5d044f
Update: At AM's request, here is a compilable version of the OP's code (2 extra curlies at the end):
#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; $/ = ""; my @InputFiles = (</usr/mlm/qa/logs/hhl/BATCH*/*/*_checksum.log>); foreach my $InputFile ( @InputFiles ) { print "$InputFile\n"; my %errors; open my $input_fh, '<', $InputFile or die "Can't open input file ($InputFile): $!"; my $uid = <$input_fh>; ($uid) = $uid =~ /UID=(\S+)/; while ( my $record = <$input_fh> ) { my ($md5) = $record =~ /METS:.+?MD5=(\S+)/; my ($filename) = $record =~ /Filename=(\S+)/; #my ($error) = $record =~ /[Error] +MD5=(\S+)/; my ($error) = $record =~ /\Q[Error]\E .+MD5=(\S+)/; if ( $error ) { $errors{$filename}{md5} = $md5; $errors{$filename}{computed} = $error; } } close $input_fh; my $count = keys %errors; foreach my $filename ( sort keys %errors ) { print join('|', $uid, $filename, $count, $errors{$filename}{md5}, $errors{$filename}{computed} ),"\n"; } }

Replies are listed 'Best First'.
Re^2: LOG FILE HELP IN PERL
by Anonymous Monk on Jan 19, 2011 at 18:25 UTC

    Not sure why the same above script is not printing the output for me.

        I added print statements to print the uid, md5,filename, error. It is printing UID but not the rest.

Re^2: LOG FILE HELP IN PERL
by Anonymous Monk on Jan 19, 2011 at 17:58 UTC

    If possible can you post the code fixed code here.