develooper Front page | perl.beginners | Postings from April 2002

file handles in cgi

Thread Next
April 3, 2002 01:35
file handles in cgi
Message ID:

this is the perl script : -- this is in my cgi-bin...

print "content-type: text/html\n\n"; 

open (IN, ">abc.txt");
$x = ($inputs{name});
print IN $x;  
close (IN);

open (IN, "abc.txt");
@arr = <IN>;
print @arr;
close (IN);

and this is the html ... abc.html(say) in the httpd/html ....


<form method="post" action="/cgi-bin/">Enter the name: 
<input type="text" name="name"> 
<input type="submit" value="click">


 if i run the .pl from command prompt with perl , i t works fine and the abc.txt is if i delete the abc.txt and run the script from the browser, the abc.txt is not created at all. i think there is something else that i might have to configure to be able to use files in please...


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About