> > > > $domain =~ m/((\w+)\.(\w+)$)/;
> > > my($dom) = $URI =~ m{://([^/:]+)};
> > What I was trying to get was just the domain without any
> subdomains,
> > ie what you would register with a registrar
>
> Ah. Sorry, I misunderstood.
> Nothing comes to mind off the top of my head.
Oh well,
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > $domain =~ m/((\w+)\.(\w+)$)/;
> > And $1 did indeed only have 'domain.com'
> > Then I realized, what about tld's like com.uk like yahoo.com.ru
> > google.com.uk
>
> Try
>
> my($dom) = $URI =~ m{://([^/:]+)};
>
> If $URI =
> "http://some.server.
--- Dan Muey <[EMAIL PROTECTED]> wrote:
> $domain =~ m/((\w+)\.(\w+)$)/;
> And $1 did indeed only have 'domain.com'
> Then I realized, what about tld's like com.uk like yahoo.com.ru
> google.com.uk
Try
my($dom) = $URI =~ m{://([^/:]+)};
If $URI = "http://some.server.com.uk:1540/other/stiff.cgi
> Hello,
>
> Does anyone know of a quick/easy/fast way to to get the
> domain out of a url?
>
> For instance if I do : $url = $cgi->url();
>
> I'll get, say http://joe.mama.com/so/isyour.cgi?mother
>
Here's a partial answer to my own question ::
$uri = URI->new($cgi->url());
$domain =
Hello,
Does anyone know of a quick/easy/fast way to to get the domain out of a url?
For instance if I do : $url = $cgi->url();
I'll get, say http://joe.mama.com/so/isyour.cgi?mother
I know I can use URI module to get the scheme (http, https, ftp, etc) from that
What I need to grab out of