Chris Stinemetz wrote:
Hello,
Hello, [*SNIP*]
#!/usr/bin/perl use warnings; use strict; use POSIX; # my $filepath = sprintf("/omp/omp-data/logs/OMPROP1/%s.APX",strftime("%y%m%d%H",localtime)); my $filepath = ("/tmp/110923.APX"); # for testing my $runTime = sprintf("/home/cstinemetz/programs/%s.txt",strftime("%Y-%m-%d-%H:%M",localtime)); my $fileDate = strftime("%y%m%d%H%",localtime); open my $fh, '<', $filepath or die "ERROR opening $filepath: $!"; open my $out, '>', $runTime or die "ERROR opening $runTime: $!"; my %date; my %cell; my %heh_type_count; while (my $line =<$fh>) { if ($line =~ /17|18|19|20|21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH/){
As you haven't changed the Input Record Separator the code "my $line =<$fh>" will read one line from the file and that line will have only one newline at the end of the line so /\n+\n+/ in the middle of your regular expression will never match.
John -- Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. -- Albert Einstein -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/