my $find = "find /path -type f -print0 | xargs -0 md5" for my $host ( @hostlist ) { open O ">$host.md5list" or die "$host.md5list: $!"; print O `ssh $host '$find'`; close O; } # compare lists here, if you like, or use a separate script/tool to do that