my $paramTemp,$contentTemp; ## $contentTemp is NOT BEING DECLARED LOCAL (very misleading) #### $content =~ s/(.*)/$contentTemp/; ## parens not needed on .*, what if $section has regex chars? #### if ($image ne '') { my $newFile = fileUpload('Image',250000,1,'latest_image','JPEG','.jpg',' +.jpeg') } ## image might be undef if param not provided.