I am creating a hyperlink to a Perl script. The hyperlink will pass a user's name and other information. I have two problems. 1) Since the GET does not allow spaces and other special characters to be passed, I've tried "encoding the data". Unfortunately, the "encoded" information is not correctly interpreted. I'm using $string =~ s/(\W)/sprintf(%%%x, ord($string)/eg

When the data is encoded ALL special characters are assigned an arbitrary value (i.e. space may be %42 one time and %54 another)

When received by the hyperlinked program, the symbol is usually the first letter of the second word.

There's got to be an easier way to do this!

2)I'd like to pass the data using POST rather than GET. However, I only know how to attach to a URL using /cgi-bin/hyperlink.pl?NAME1=value1&NAME2=value2

2) I'm confused. Are you referring to just passing data, or being able to, let's say, bookmark a page after data has been passed through POST. The latter won't work. The former can have data passed via html's <INPUT TYPE=HIDDEN VALUE="whatever"> tag. If I didn't answer your question, could you please elaborate a little?

This calls next_page.pl and passes the two values to the Perl script. However, the amount of data that can be passed is server dependent. I was wondering if there is a way to invoke POST rather than GET from the hyperlink.

The "escape" and "unescape" in CGI.pm aren't modules, they're subroutines within the CGI.pm module.

If you're just trying to pass 2 values to your program, there shouldn't be a length problem.

Unless you use a Javascript thingie to post to a form using a text link (not advised), or an image form submit button, there's no other way I can think of right now to post without the ugly grey buttons.

When you use hyperlinks to carry information it uses GET. To use POST(so people cant see the information on the url) you have to use hidden tags not hyperlinks.

So, for hyperlinks use the escape subroutine to filter the url coding(this way you can have spaces and etc in your password(or whatever) and the escape subroutine will encode it to the url specifications.

In this example, I have a form field name name1(user-name) and name2(user-password)