Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am accepting data from a form via the net and wish to store the data into a file. I have done this, however, any characters other than letters of numbers have a problem. The commas, question marks, and such are all tranlsated into HEX. How do I store the data to avoid this? (ASCII?) When I print them out onto the web I see the special characters as HEX values. Thanks in advance.

Replies are listed 'Best First'.
Re (tilly) 1: ASCII Conversion
by tilly (Archbishop) on Aug 22, 2000 at 04:24 UTC
    If you are using CGI.pm to process data from the web, you should have no problems with properly receiving commas etc from input forms. (As well as improvements in security, flexibility, etc.)
(Ovid) Re: ASCII Conversion
by Ovid (Cardinal) on Aug 22, 2000 at 05:22 UTC
    tilly is correct that CGI.pm will solve these problems for you, however, you mentioned printing them to the Web. If this is for personal use with debugging, that's probably not an issue. However, if you are doing this for production, it's easy to open up a security hole here. For example, a person may be able to execute a server side include as the server's user. Not good.

    Other issues allow them to include random HTML or other things that aren't intended. Read up on security issues to find out how to deal with some of these problems.

    Cheers,
    Ovid