#!/usr/bin/perl -w use strict; my $arin="/usr/bin/whois -h whois.arin.net"; my $ip = "216.68.40.234"; my $result = `$arin $ip`; if ($result =~ m/xxx/){ $result =~ m/\((.*?)\)/g; print "The handle is: $1\n"; print "The 2nd handle is: $2\n"; }