scripting with perl
well, i'm just learning perl (and i realized, i'm not alone... ). for getting used to the syntax, i'm trying to write a little script on my own (changing other scripts is doing well). it's a very simple one, here we go (it's only the 'problematic' part):
print << "EOM"
<form action="/cgi-bin/script.pl" method="POST">
<select name="id1" OnChange=submit()>
<option value="0">-------</option>
<option value="1">Value 1</option>
<option value="2">Value 2</option>
<option value="3">Value 3</option>
</select>
</form>
EOM
;;
if ($list{'id1'} eq NULL) {
print "error";
} else {
if ($_{'id1'} == "1") {
print "hi";
} else {
print "hello";
}
}
if "value 1" is selected, print 'hi', else print 'hello'.
so, how can i tell the script, it has to take the value of 'id1'? i thought i would do that with $list{'id1'}, but i realized, i'm not.
i think it's only a very little thing somewhere, and i'm sure you can help me out... thank you!
Orpheus posted this at 13:30 — 2nd June 2000.
They have: 568 posts
Joined: Nov 1999
You have to make a form processor
try something like this
merlin posted this at 13:37 — 2nd June 2000.
They have: 410 posts
Joined: Oct 1999
thank you orpheus (for the 2nd time, are you something like my guardian angel? ).
i'll try that during my weekend... thank you!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.