in reply to What's wrong with my syntax?

As was allready pointed out change local to my. But you need to take the declaration out of the foreach block too. Like that:
my @name; my @vhost; foreach (@_){