A way, with URI (this is not complete, fragments and queries must be dealt with too; read the docs to see how and write some tests to be sure it's behaving as you expect).
perl -MURI -le '$u = URI->new(shift); $u->path(undef); print $u' http: +//www.abc.com/def/ghi.html http://www.abc.com
In reply to Re: modify a URL
by Your Mother
in thread modify a URL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |