in reply to Get the filename from the end of a URL

File::Basename works just fine for URLs are well as real filenames:
use File::Basename; print basename 'http://www.plenty.org/downloads/crap.exe';
Update: This does break if the url is something like http://www.plenty.org/downloads/crap.exe?foo=/path/to/something. But so do the others example, I believe.

Replies are listed 'Best First'.
Re: Re: Get the filename from the end of a URL
by petdance (Parson) on May 24, 2001 at 17:39 UTC
    yesbut, what if the URL is ...?
    http://www.plenty.org/downloads/crap.exe?foo=/path/to/something

    xoxo,
    Andy

    %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
    'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
    "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >