in reply to problem in mkdir

What does it say if you print error message of mkdir?
mkdir ("/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1",0775) o +r print "in mkdir:$!";

And maybe, you had better put your question not in "PerlMonks Discussion" but "Questions"...