in reply to Re^3: export variable outside foreach
in thread export variable outside foreach

My bad, I read "@lines is empty" correctly, but understood "@lines contains empty strings" :).