in reply to Need help with string extraction

I can only guess which line causes the error, but in this line you have lost a comma:

print $_ "\n";