my (@new_dat) = (); foreach my $line (@loaded_data) #-- loop thru all data { chomp($line); my (%trec) = &line2rec($line); sleep 1; if ($trec{'active'}) { push(@new_dat, $line); } }