Take three form variables and write to an "settings-file"

R

Rickard

Hi.

I am so very new to perl that i have to ask for help. :)

This is what i need help with:


I have an web page, it contains an form with three textfields and one
Submit button.

What i want it to do is to take those variables from the three
textfields and put them in an local file on the webserver.

the file should be formatted like this (with tab separated fields)

variable1 content1
variable2 content2
variable3 content3


Where variable 1-3 is then "name of the line" and content 1-3 is the
"value".


This information is later on used in shell scripts running on the server.

So this should be some kind of admin frontend to the scripts.


Please help me.


//Rickard Hansson
 
G

Gunnar Hjalmarsson

Rickard said:
I am so very new to perl that i have to ask for help. :)

That's not a reason in itself to ask for help in a newsgroup.
This is what i need help with:

*Why* do you "need help"? Can it possibly be because you haven't tried
yourself, and simply hope that others will do your work for you? Your
problem is trivial, so it's well covered by the Perl documentation as
well as numerous books, tutorials, etc.

Have a look at
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

and make a serious try to fix it by yourself.
 
P

Paul Lalli

Hi.

I am so very new to perl that i have to ask for help. :)

This is what i need help with:

I have an web page, it contains an form with three textfields and one
Submit button.

What i want it to do is to take those variables from the three
textfields and put them in an local file on the webserver.

the file should be formatted like this (with tab separated fields)

variable1 content1
variable2 content2
variable3 content3

Where variable 1-3 is then "name of the line" and content 1-3 is the
"value".

This information is later on used in shell scripts running on the server.

So this should be some kind of admin frontend to the scripts.

Please help me.


What have you tried so far? What didn't work the way you expected?

Have you ever done any CGI programming with Perl? If not, please read the
documentation:
perldoc CGI
or
http://www.perldoc.com/perl5.8.4/lib/CGI.html

Once you've learned enough to make an attempt, if it doesn't work, let us
know and we can help you debug.

Paul Lalli
 
R

Rickard

Paul said:
What have you tried so far? What didn't work the way you expected?

Have you ever done any CGI programming with Perl? If not, please read the
documentation:
perldoc CGI
or
http://www.perldoc.com/perl5.8.4/lib/CGI.html

Once you've learned enough to make an attempt, if it doesn't work, let us
know and we can help you debug.

Paul Lalli

Well actually, i have never done PERL CGI scripting.

But thanks for the link, i will start reading directly.

Sorry for taking up your time.

//Rickard H
 
E

Eric Schwartz

Rickard said:
Well actually, i have never done PERL CGI scripting.

The CGI.pm docs are nice, but there is also a nice book on the
subject, "CGI Programming with Perl", that you might find helpful.

Regardless, I recommend you read through the CGI.pm docs completely
before starting to use it, as there are many code samples that may be
helpful.
But thanks for the link, i will start reading directly.

No-one has mentioned this yet, but if you will have more than one
person running this CGI program at once (very likely, in a web
environment), and they all modify the same file, then you will want to
lock the file after opening it. See 'perldoc -f flock' for more
information. Read that one carefully, as well.

-=Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,404
Latest member
PerryRutt

Latest Threads

Top