use URI; my $url = 'http://foo.bar.com'; my $uri = new URI($url); if( $uri->host =~ /[a-zA-Z\-]/ ) { # or /[^\d\.]/ # it's an IP dag-nabbit }
____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.
In reply to Re: Re: Re: Re: Getting IP from URL
by PodMaster
in thread Getting IP from URL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |