Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to read each line of file into an array and split contnts of each line into array cells

by crazy-duck (Novice)
on Sep 30, 2013 at 11:03 UTC ( #1056330=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056330]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2018-07-19 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (398 votes). Check out past polls.

    Notices?