My suggestion is to internalize your grep command as such (I hope I'm using seek() properly here)
open( FILE, "/PHL/data1/PHL/tmp/ECL_STAT.txt" )
or die "Couldn't open ECL_STAT.txt: $!";
my $found = 0;
foreach $item(@timearray){
seek( FILE, 0, 0 );
$searchstring = "$NETID\|$month\/$date\/$year\|$item\|";
while( <FILE> ) {
if( /^$searchstring/ ) {
push @ECL, $_;
$found = 1;
last;
}
}
push @ECL, "||$item||" unless $found;
}
close( FILE ) or die "Couldn't close ECL_STAT.txt: $!";
This is probably a bad suggestion, but it's what I think is right.
-- Dave