in reply to Re^5: Will this work?
in thread Will this work?

What I am trying to accomplish is to ... write data gathered from an html form to a user selected directory from the same form...

How many different users do you expect? Will each user start with their own personal "home" directory for their 27 subdirectories? (Obviously, I think it would be a bad idea to allow all users to make or use the same set of directories -- you're bound to get two or more people who want to use a path called "stuff" or whatever.)

For that matter, does it really make sense for the user to make a deliberate choice about which subdirectory to use for a given submission? Would it make more sense for the directory choice to be "automatic" (e.g. based on some other aspect of the submission)?

I didn't see anything (in any of your posts on this thread) that shows the html for the input form itself. How many pieces of input is the user providing when the form is submitted? What else does the user get to do besides submit stuff that will be stored in a file? (For example, what do they do next, after storing something to a file?)

In terms of "understanding scriptng", the basic structure of any CGI application goes like this:

  1. Look at the input parameters (use CGI to do this easily)
  2. Do something appropriate on the server based on what the parameters tell you (e.g. read from file(s) or from a DB, write to file(s) or DB, do some arithmetic or string editing or ...)
  3. Send some suitable response back to the client (send back a confirmation page, or another instance of the current form, or a new form, or redirect to some other page, etc). Sending back html data for display involves printing to STDOUT; the CGI module helps with this too, but various template modules (e.g. HTML::Template) are also good.

That's pretty much it. The rest is just structuring the task based on: what you need to present to users, what you expect to get from users, what to do when they don't send you what you expect, and what to do when you can't give them what they need.

If that's not enough to help you get a fresh start, I think the best course of action will be to start a fresh thread, with a different question and (if possible) a different initial attempt at perl scripting -- maybe start with some example from NMS or the CGI module manual page -- and maybe some more detail about what you're really trying to accomplish.

Oh, I know the CGI man page is huge -- it's a book all by itself -- but you'll be glad when you get familiar with how well it's organized and how useful the examples are.