Home: Perl Programming Help: mod_perl:
File I/O Problem - Help Needed



modpluz
New User

Aug 11, 2008, 2:18 AM


Views: 18079
File I/O Problem - Help Needed

Good day,
please i have a file input/output problem, while would this code be displaying a blank page.

here is my code;

Code
sysopen (HTML, 'myhtml.html', O_RDWR|O_EXCL|O_CREAT, 0755) or die "$filepath cannot be opened."; 
printf HTML "<html>\n";
printf HTML "<head>\n";
printf HTML "<title>My Home Page</title>";
printf HTML "</head>\n";
printf HTML "<body>\n";
printf HTML "<p align='center'>This is a test paragraph.</p>";
printf HTML "</body>\n";
printf HTML "</html>\n";
close (HTML);



gnix
Novice

Feb 17, 2009, 4:50 PM


Views: 13414
Re: [modpluz] File I/O Problem - Help Needed

I tried your code using the Fcntl module and it works correctly. Maybe, you forgot to insert "use Fcntl;" on the top of your script.

gnix

Edit: Is not necessary the eXecution permission for a HTML file.


(This post was edited by gnix on Feb 17, 2009, 4:52 PM)