while (<>) { if(/START/.../END TIME (.+)/) { next if(/START/ | /^\s*$/); print; } }