in reply to scope of variables in a sub
My (weak) guess is you have an empty match setting $vsowner to undef at some point.
What happens if you change .* to .+ ?
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
No difference, the data comes from a database and there are no empty records in the source, you can see the variables it populates, printed inside the foreach loop, and then untouched till it's printed outside the loop where it is uninitialized.