$subject="http://www.spied.co.nz/thinmailer.cgi"; $filename = (split(/\//, $subject))[-1]; print $filename;