You probably have blank lines in your input.
In the split doco, under "As another special case, ...", you'll see how your pattern (' ') is handled specially.
Whenever $line equals "\n", split(' ',$line) will return (): all of those 10 variables ($site, ..., $length) will be undef (i.e. "uninitialized value").
If you want to ignore them, you can do something like this:
foreach my $line (<LOGFILE>) { next if $line =~ /\A\Z/; ($site, ... ... }
[Aside: $a and $b are not good choices for variable names as they have special meaning to Perl - see perlvar]
-- Ken
In reply to Re: Use of uninitialized value $site in concatenation (.) when excute the perl script
by kcott
in thread Use of uninitialized value $site in concatenation (.) when excute the perl script
by laksh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |