open(INPUT, "ml_test.html"); while () { $text .= $_; } close(INPUT); if ($text =~ /\bclb_new>\b(.*?)\b<\/a>/g) { print $1; }