while( my $line = ) { chomp $line; next if $line !~ m/data\sto\s(.*?)\s*is/i; # ....the rest of the loop goes here... }