in reply to A question on Regex
A non-regex way. This is overkill for one-offs but you can see it's actually quite terse and grows well. URI and Path::Class.
use URI; use Path::Class; my $uri = URI->new("http://192.162.143.201/nightly_results/2009_12_02/ +log_lcla114.ping.com_64.html"); my $path = Path::Class::File->new($uri->path); print $path->basename, $/;
|
|---|