I've made a few programs which deal with filenames of URL's and I take the same approach as you, although I use a slightly different method. To me it's more important that you use what you're comfortable with since you're the one that will probably be reading the code later.
$subject="http://www.spied.co.nz/thinmailer.cgi";
$filename = (split(/\//, $subject))[-1];
print $filename;