in reply to match loop failure
foreach ($line2) { [download]
Generic advice:
Apologies it was a first post. You were correct about the scalar. Thanks for your help.