#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;

my ($twh,$registrar,$username,$password,$proc);
my ($debug,$hangup);
my $p=@ARGV;
usage() if ( @ARGV !=10 or !GetOptions(
    '-u=s' => \$username,
    '-p=s' => \$password,
    '-h=s' => \$registrar,
    '-d=i' => \$twh,
    '-n=i' => \$proc,
 ));

sub usage {
    print "Usage: $0 -u 'user' -p 'passwd' -h 'host' -d 'duration' -n 'process number'\n";
    exit;
}

for (my $j=0;$j<$proc;$j++) {
   system "./regsiping.pl -u $username -p $password -h $registrar -d $twh &";
}
