Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Web broadcast e-mail perl scriptby wfsp (Abbot) |
on Aug 21, 2010 at 16:14 UTC ( [id://856477]=note: print w/replies, xml ) | Need Help?? |
I think dasgar has identified the reason you are getting that output from your script.
Not what you want perhaps but it does reveal that
The script has warnings enabled (the -w on the shebang line) and uses CGI.pm. Also a good thing. If you're starting out on working with cgi scripts I would suggest putting your script to one side and writing a cut down version and get that working. For instance, if you are able to create a dir under cgi-bin you could create a /cgi-bin/test/test.cgi like the following (i.e. leaving out the email side of things). test.cgi I've tried to keep the script as close to yours as possible (differences have comments) so that it will be familiar but have taken out the email stuff. Get this bit working first. Set the permissions to executable (0755 ought to do it). A test.txt somewhere you can find it e.g. And a test.html in, say, the document root The html has a lot of whitespace blown into it which I find useful while developing. Typing http://your_domain/test.html into your browser should bring up the form. Fill in some dummy data and, if the wind is in the right direction, you will see something like and there should be a file upload_file.txt in cgi-bin/test or wherever you set the path to in the script. There are a number of good tutorials that will help and it is worth have a look at the docs for CGI.pm (at least, the methods that you are using - there is rather a lot of it). There are a number of improvements that could be made (secutity, error checking etc) and many other approaches to developing cgi scripts (e.g. setting up your own local web server rather that 'playing' on a production server) but I reckon it's best to build up gradually . Hope this helps, let us know how you get on and get back to us if you need any more help. By the way, your introduction to perl was identical to my own. :-) Good luck!
In Section
Seekers of Perl Wisdom
|
|