my $URL = "http://www.mysite.com/images/uploads/1050084447_4.jpg"; # retrieves the image name from the URL my $image_name = (split /\//, $URL)[-1]; print "$image_name\n";