dos2unix through web gives error: Couldn't open output file udiiaqHC

I need to remove dos characters from a text file from my html page.

I wrote the following lines in a perl file cleanup.pl
 and added the line  <!--#exec cmd="./ident.pl" -->  in my html file

$d=`dos2unix results.txt  results.txt`;  //results.txt has permission 777
print "done...........";

This is the output I got:

dos2unix: Couldn't open output file udiiaqHC.
                 Permission denied. done...........

Any idea why this error comes up?
I found that udiiaqHC is a random thing, if I do a page refresh, I get some other string like udpQayIC
rajasreeAsked:
Who is Participating?
 
dorwardConnect With a Mentor Commented:
It looks like it is trying to create a tempory file, possible in the same directory, possibly elsewhere. Make sure the webserver has permission to write to that directory.
0
 
rajasreeAuthor Commented:
typo error above.  
my html file calls cleanup.pl
<!--#exec cmd="./cleanup.pl" -->

cleanup.pl has contents:
$d=`dos2unix results.txt  results.txt`;  //results.txt has permission 777
 print "done...........";
0
 
rajasreeAuthor Commented:
Cool!
It worked when I changed the directories permissions.

Thanks for your help,
Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.