Replace this:
elsif(($vsowner) = ($_ =~ /vs_owner =\s+(.*)/)){ print "VSOWNER:$vsowner\n"; }
With this:
elsif ( /vs_owner =\s+(.*)/ ){ $vsowner = $1; print "VSOWNER:$vsowner\n"; }
Your problem is that $vsowner is being set on one iteration of the loop, but being unset the next time around the loop.
Fix your other if/elsif checks too.
In reply to Re: scope of variables in a sub
by tobyink
in thread scope of variables in a sub
by frontrange
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |