Sorry for the late reply, but the rules for CGI are pretty simple concerning this and using a bulky module such as CGI for something simple may not be the optimum path for your needs.
Basically, you can think of the url as the commnad line, with the full "path" to your command being the familiar url: http://mydomain.com/scripts/myperlscript.pl Now, this runs myperlscript.pl without any "arguments" (assuming we are not using POST, see below). If we want to add a "command line argument", we put a ? on the end, and whatever is after the ? is passed to the script: http://mydomain.com/scripts/myperlscript.pl?1 $ARGV[0] is "1". http://mydomain.com/scripts/myperlscript.pl?1+Z $ARGV[0] is "1" $ARGV[1] is "Z" At this point, you can pass small, simple, alphanumeric arguments to your script. All of this will have to be done by hand in the sense that html forms work a bit different. Hardcoding your href's is pretty simple though for simple things. Something like th following would work: <a href="myperlscript.pl?A">Run script with option A</a> <a href="myperlscript.pl?B">This time with option B</a> In order to use html forms though, you have to understand CGI, the GET method and the POST method. When you submit the form, via GET or POST, CGI will put the input tags in the following format: name=value, an &, followed by the next name2=value2 set. This is client side, and your browser is doing the CGI. An example would be (using GET): The form contains: <input type="text" name="formname1"> <input type="text" name="formname2"> Your browser grabs the following url: http://mydomain.com/scripts/myperlscript.pl?formname1=value1&formname2=value2 The browser should change spaces into + signs and change any non-alphanumeric data into hex. For example: "one # 1 *" can be translated into: myperlscript.pl?one+%23+1+%2A If you want, you can make some routines to chop up what's passed to the script based on these rules, or you can use the Perl CGI module. Personally, I learned the hard way and made some routines to parse this data. They may not be as universal as the CGI module, but they get the job done. Making the subroutines to do this is beyond the scope of this mail, so using CGI, or something that is already written, is recommended. If you really want to write one though, browsing through the source for CGI, or any of the others, should give you an idea of which direction to go. The only difference between GET and POST is how data is passed to your script. I got the following from some site (webmonkey.com I think, it's been a while) and it explains how data is passed depending on GET or POST. if ($ENV{'REQUEST_METHOD'} eq "GET") { $form_data = $ENV{'QUERY_STRING'}; } else { $form_data = <STDIN>; } Basically GET is passed via an ENV variable, and can only be so big since there is a limit on the size of a ENV variable. POST is sent via STDIN, and can be as big as needed. The best way to understand all of this is to use the following code and play. Look at the url when you submit, noting the difference between GET and POST. Note how the text is translated for non-alphanumeric characters by your browser. #!/usr/bin/perl # This file must be named foo.pl, or edit # the action section of the form tag. print "Content-type: text/html\n\n"; print "GET<br>\n"; print "<form action=\"foo.pl\" method=\"GET\">\n"; print "<input type=\"text\" name=\"field1\">\n"; print "<input type=\"text\" name=\"field2\">\n"; print "<input type=\"submit\">\n"; print "</form>\n"; print "POST<br>\n"; print "<form action=\"foo.pl\" method=\"POST\">\n"; print "<input type=\"text\" name=\"field1\">\n"; print "<input type=\"text\" name=\"field2\">\n"; print "<input type=\"submit\">\n"; print "</form>\n"; if ($ENV{'REQUEST_METHOD'} eq "GET") { $form_data = $ENV{'QUERY_STRING'}; } else { $form_data = <STDIN>; } print "<p>\n"; print "$form_data <br>\n"; exit(0); =-= Robert Thompson On Wed, Nov 14, 2001 at 07:21:09PM +0100, I.J. wrote: > Hello, > I am not sure how to pass arguments when working on web? Is there some > online tutorial about this? > Surfing on web, and peeking my address bar, I noticed that it lokes > somenthing script.pl?t=text&o=orange. > How to work with those arguments in the script? > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]