BlueInk has asked for the wisdom of the Perl Monks concerning the following question:
The input is as follow's#!/usr/bin/perl -w use Geo::IP; use strict; Xchat::register( "Whois Addon", "0.5", "A Geop and ip resolver for irc +op's for the whois command", "" ); Xchat::hook_server('378', \&parse_line); my $servertabname = "Station51"; sub parse_line { my ($line); $line = shift (@_); Xchat::print("test1",,$servertabname); if ($line =~ m/:.+\@.+\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0- +9]{1,3})/){ Xchat::print("test2",,$servertabname); my $ip = $1 ; Xchat::print("Is From ".countryname($ip)."",,$servertabname); } Xchat::print("test3",,$servertabname); } sub countryname{ my ($ip) =@_ ; my $gi = Geo::IP->open("/home/m/Desktop/Test Stuff/GeoIP.dat", GEOIP_S +TANDARD); return $gi->country_name_by_addr($ip); }
how ever with the print statements the out put israndom.ircserv.net 378 ircop Blueink :is connecting from *@78.273.80.2 +3 78.273.80.23
Which tell's me the regex is not being accepted does any one have any idea why this is ??? Thanks -- Blueinktest1 test3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Frustration With regex
by kennethk (Abbot) on Sep 16, 2009 at 23:08 UTC | |
|
Re: Frustration With regex
by Corion (Patriarch) on Sep 17, 2009 at 07:05 UTC | |
|
Re: Frustration With regex
by grizzley (Chaplain) on Sep 21, 2009 at 07:37 UTC |