sub run_command { my $user = 'gmon'; my $system = shift; my $protocol = 'ssh'; my $ssh_flags = "-l $user"; my $command = "statvv -ni"; my $space = " "; my $do_command = $protocol . $space . $ssh_flags . $space . $system . $space . $command; print "Running [$do_command]\n"; my $cmd = IO::Pipe->new; $cmd->reader($do_command); return $cmd; }