when I am running the perl script where I user foreach to read the file line by line I got the print message.
"Use of uninitialized value $site in concatenation (.) or string at logfile.pl line 13, <LOGFILE> line 19."
#!/usr/bin/perl -w
use strict;
use warnings;
my ($time, $site, $logName, $fullName, $date, $gmt, $req, $file, $prot
+o, $status, $length);
$site;
my $LOGFILE = "config.txt";
open LOGFILE,"$LOGFILE" or die "cannot open file : $!";
foreach my $line (<LOGFILE>) {
($site, $logName, $fullName, $date, $gmt,
$req, $file, $proto, $status, $length) = split(' ',$line);
my $a = "$site\n";
print "--$a\n";
my $b = "$logName\n";
print "==$b\n";
}
close(LOGFILE);
Please let me know where I am doing the mistake.