#!/usr/bin/perl
###########################################
# ips -- run a script on a remote machine
# Mike Schilli, 2004 (m@perlmeister.com)
###########################################
use warnings;
use strict;

use Sysadm::Install qw(qquote);

my $script = q{
    $data = `ifconfig`;
    while($data =~ /inet addr:(\S+)/g) {
       print "$1\n";
    }
};

$script =~ s/\s+/ /g;

my $cmd = "perl -e " .
    qquote($script, ":shell");

$cmd = "ssh -t somehost " . 
       qquote($cmd, ":shell");

system($cmd);
