$path = "/dir_name/sub_dir_name/"; #Determine if the image file exists my $fn = $path.$Data{dr_id}.'.jpg'; if (-e $fn) { my $image = $fn; } else { $image = $path."DefaultPhoto.gif";