in reply to Uploading and writing to a text file
Hi!
I'm a bare novice, so please bear with me.
Okay, turning off flamethrower. As a tip, when asking for help, you should try to:
I need a subroutine that would allow me to upload several images and write some input to a text file all at once.
Okay. There are multiple issues here.
This is easily done in perl. Check out the documentation for open, close, and print.
Here is an instance of not being specific about the problem. "Uploading" can happen various ways. I'll assume you mean via a Web page, but if you don't, please clarify.
As mentioned, you should use the CGI.pm module. If you aren't familiar with using modules, you should learn, as it is the single best time saver in perl (and there are a lot). A good place to start is perlmodlib.
The documentation for CGI.pm is a bit...rambling. If you're familiar with HTML, I'd recommend you skip the sections describing HTML-generating functions for now. You'll want to look at the param(), header(), and upload() functions. Also notice that you need to properly set the enctype field for your form (details in the CGI documentation).
|
|---|