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"; } }

In reply to Re: LOG FILE HELP IN PERL by toolic
in thread LOG FILE HELP IN PERL 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.