in reply to Regex Question

Use URI.

use strict; use warnings; use URI qw( ); for ( 'http://www.example.com/cgi.pl?x=y#anchor', 'http://www.example.com/cgi.pl?x=y', 'http://www.example.com/', 'http://www.example.com', ) { my $uri = URI->new_abs('/', $_); print("$uri\n"); }
http://www.example.com/ http://www.example.com/ http://www.example.com/ http://www.example.com/

Replies are listed 'Best First'.
Re^2: Regex Question
by Anonymous Monk on Jan 04, 2009 at 06:33 UTC
    Ahh... but I can't use the URI module as it's not installed and I can't get it installed.

      Then you have a broken Perl. It comes with Perl (No, only with ActivePerl)

      What problems are you having while trying to install it?

        I checked the Perl Core Modules and didn't see it in there. Where else do I check to see if it's a core module or am I totally off base?
        It's a friend's web server and he doesn't have that kid of clout.
          A reply falls below the community's threshold of quality. You may see it by logging in.