#!/usr/bin/perl while () { chomp; open(H, "ssh $_ 'uptime' 2>&1 |"); $b = ; close(H); printf("%s: %s\n", $_, $b); }