C:\>perl -MURI -e"die $_= ( URI->new( shift )->path_segments )[-1] " /somepath/script.php/image.jpg image.jpg