open(INPUT, "ml_test.html"); # Read in the entire file into a single string. my $text = join ('', ); close(INPUT); while ($text =~ /\bclb_new>\b(.*?)\b<\/a>/g) { print $1; }