[Rt-commit] r9402 - in rtir/branches/2.3-EXPERIMENTAL: .

sartak at bestpractical.com sartak at bestpractical.com
Mon Oct 22 16:31:50 EDT 2007


Author: sartak
Date: Mon Oct 22 16:31:49 2007
New Revision: 9402

Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/Elements/GetEmailFromIP

Log:
 r44009 at onn:  sartak | 2007-10-22 16:31:40 -0400
 More logic cleanups


Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/Elements/GetEmailFromIP
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/Elements/GetEmailFromIP	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/Elements/GetEmailFromIP	Mon Oct 22 16:31:49 2007
@@ -28,23 +28,18 @@
 # Net::Whois::RIPE does this for its method names
 $field =~ tr/-/_/;
 
+$$address = loc("ADDRESS_UNKNOWN");
+
 use Net::Whois::RIPE;
 my $whois = Net::Whois::RIPE->new( $server, Debug => 1 );
 if ($whois) {
   my $query = $whois->query($q);
-  $$address = "";
-  foreach my $attribute ($query->attributes()) {
-    last if ($$address);
-    next unless ($attribute eq $field);
-    foreach  my $value ($query->$attribute()) {
-      $$address = $value;
-      last;
-    }
+  if ($query->can($field)) {
+    $$address = $query->$field();
   }
 } else {
   $$error = "Unable to connect to whois server '$server'";
 }
-$$address = loc("ADDRESS_UNKNOWN") if !$$address;
 </%INIT>
 
 <%ARGS>


More information about the Rt-commit mailing list