http://www.perlmonks.org?node_id=1056330


in reply to Re: How to read each line of file into an array and split contnts of each line into array cells
in thread How to read each line of file into an array and split contnts of each line into array cells

#!/usr/bin/perl; use strict; use warnings; use Getopt::Long; my @ARRAY = (); my $ARRAYlength = -1; my $FILEname="/var/log/logfile.txt"; open FILE, $FILEname or die "couldn't open $FILEname: $!"; while (<FILE>) { @ARRAY = <FILE>; print "@ARRAY\n" } close FILE or die "problems closing $FILEname: $!";,<

Output of above script: **FAILED PROD** - BUGS - 08/26/13 @11:12 - BUGS~23AUG13~23AUG13~23AUG13~26AUG13~1109

**FAILED PROD** - cockroach - 08/29/13 @11:52 -cockroach~29AUG13~29AUG13~29AUG13~29AUG13~1152

Iam able to read the logfile lines into array and at this point I want to split components of each line and check the time and alert if it is between 18hrs to 6AM following day.

  • Comment on Re^2: How to read each line of file into an array and split contnts of each line into array cells
  • Download Code