I'm new to perl, but this question possibly has more to do with what I may need to find out from the tech support for the service for our churches webpage. I've been trying to write a script to test that will write a simple text file to the server.
I have been using this script (pasted below) , thier perl is enabled because it prints "Hello world" to my browser window.
It just never writes a file and I get no errors in the browser.
I talked to the tech support there and they are running MS IIS 6.0 server software and has told me he has given permission for the script to read and write. It doesn't seem like they know much about scripting there.
I am not in control of who our church uses for server space so I'd appreciate any help in what I can possibly do or ask of that service to get a script to write a file.
Thanks
This is the script.
#!/usr/local/bin/perl
print "Content-Type: text/html\n\n";
print "<html> <head>\n";
print "<title>Hello, world!</title>";
print "</head>\n";
print "<body>\n";
print "<h1>Hello, world!</h1>\n";
print "</body> </html>\n";
$append = 0;
if ($append) { open(MYOUTFILE, ">filename.out");
}
else
{
open(MYOUTFILE, ">>filename.out"); #open for write, append
}
print MYOUTFILE "Testing 1 2 3"; #write text, no newline
print MYOUTFILE "\n"; #write newline
close(MYOUTFILE);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.