RE: get domain only with CGI or URI modules

2003-02-18 Thread Dan Muey
> > > > $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,

RE: get domain only with CGI or URI modules

2003-02-17 Thread Dan Muey
> --- 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.

RE: get domain only with CGI or URI modules

2003-02-17 Thread Paul
--- 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

RE: get domain only with CGI or URI modules

2003-02-17 Thread Dan Muey
> 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 =

get domain only with CGI or URI modules

2003-02-17 Thread Dan Muey
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