in reply to Use of uninitialized value in open

One other thing if I may, when reporting an error from open is is usually best to include the filename and the reason for the failure ($!), for example:
open(my $hlogfile,'<',$LOGFILE) or die "Could not open $LOGFILE: $!";