in reply to Subroutine arguments problem

Use this instead:
sub queryProcesses ($) { my ($server) = @_;
The thing after the subroutine name isn't a parameter list like you would see in other languages, it's a prototype. See perldoc perlsub.