in reply to Re: URI plus File::Spec::Unix -- good idea or bad?
in thread URI plus File::Spec::Unix -- good idea or bad?

$uri->path_segments is interesting and useful, but it doesn't solve the "behave the same whether $base ends with a slash or not" problem.

change the code to my $base = 'http://foobert.org/dir/odir/'; and you get http://foobert.org/dir/odir//foo.html, with two slashes!

Replies are listed 'Best First'.
Re^3: URI plus File::Spec::Unix -- good idea or bad?
by mreece (Friar) on Aug 25, 2006 at 16:55 UTC
    however, this will do it :)
    print $uri->path_segments( grep { $_ } $uri->path_segments, $file );
    uses grep to filter out the empty strings returned by path_segments.

    updated: fixed typo