Help for this page
print {$filehandles[$i]} $line if $line =~ /$regex[$i]/;
print {$filehandles[$i]} $line if ($line =~ /$regex[$i]/../^END/);