I see two problems
- You're closing the input filehandle inside the loop after reading the first record from it. The while loop ends after the first record because the read on the closed filehandle returns false.
- $text .= $_; appends each input line to $text.
Try something like this:
while (<INPUT>) {
while ( m!clb_new>([^<]+)</a>!g ) {
print $1;
}
}
conv
Update:
- I should change my nick to "Update"
- I misread your code. You were appending the input to $text, then parsing it. The code I posted should work though.