Hello all,
I have received a solution for my problem (reading from log) from Tom
Kinzer. The code is:
#!/usr/bin/perl -w
use strict;
my $log_file = "/appl/log/00004e4d/20031130.txt";
open LOG, "< $log_file" or die "Could not open file $!";
while ( <LOG> ) {
chomp;
if ( /^GTotal Content:/ ) {
my ($gtotal_content, $value) = split(/:/, $_);
print $value;
}
}
close LOG;
The problem is this code returns no value. When I remove all preceding
lines from the log (20031130.txt) and keep there only that GTotal
Content: 14,741,322, I will get desired result (14,741,322)
What may be a solution for this?
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>