Jay Savage wrote:
On 1/4/07, Igor Sutton <[EMAIL PROTECTED]> wrote:
> I tried this Igor and it doesn't do exactly what I'm looking for. I
> checked the docs and don't think it will do exactly what I want. I need
> to do some more reading though. What I want to extract is the domain
> name, ala:
>
> asldkjlkwerj.com
> alaskjhhawe.com
> qwlkjekwl.com


It's right, because URI gives you the host part of uri.

What is the problem you are trying to solve?

It gives the host, not the domain. Given input like
'http://www.example.com/some.html', he wants 'example.com' (the
domain), not 'www.example.com' (the "host"/fqdn). I'd try something
like:

   my $domain = $1 if $uri->host =~ /^.+\.([^.]+\.[^.]+)\s*$/; # untested

HTH,

-- jay

Thanks Jay. I will give this a whirl.

Mike

--

UNIX is many things to many people, but it has never been everything to anybody.
  03:30:01 up 17:49,  0 users,  load average: 0.68, 0.53, 0.45

 Linux Registered User #241685  http://counter.li.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to