in reply to Re^9: Save form data with decoded URL chars
in thread Save form data with decoded URL chars

This : "...save is a CGI.pm serialization method, if you want to read the file again, use CGI.pm's new, ..."

What do you mean by undo serialization ? Go back on browser or ?

  • Comment on Re^10: Save form data with decoded URL chars

Replies are listed 'Best First'.
Re^11: Save form data with decoded URL chars
by Corion (Patriarch) on Aug 09, 2012 at 09:25 UTC

    Maybe you want to follow the Anonymous Monk's link to "serialization"? To undo serialization would mean to reverse the process of serializing data.

    Maybe you can explain to us what overarching problem you're trying to solve? Saving requests to a file is a measure I've only used for debugging CGI scripts.

      Hej Corion and thanks for your reply !

      As I've already wrote I'm saving a form data in a .csv file in order to manipulate it later on (say that I'll add some *ix commands later on to every record in a file). The thing is that when I use $qry->save, I get key=value pairs saved with URL encoded characters. I then manipulate that file to get it "back" to CSV format, but all of my Swedish letters (ISO-8859-1 formated from the beginning) are URL formated characters now.

      I did then (after help from Anonimous Monk(s)) a subroutine which can manipulate the file once more to get proper formating for Swedish letters, but I was just asking if it was possible (somehow) to get characters URL decoded before file is saved.

      Now Anonimous Monk made a great effort trying to explain to me some things, but I'm sorry, I'm just too stupid to understand it.

      And because time is running and I have a work to do at my workplace (which besides has nothing to do with programming) I've chosen to manipulate a file one more time and run it through my subroutine that will get Swedish letters back in the right format.

        Don't use save, the sole purpose of save is to write a CGI object to disk, and read it back from disk

        Don't parse a ->save'd to get data out of it, that is a job for CGI.pm

        You already have a CGI object, use it, use the param method to get the posted form data, then use open and http://search.cpan.org/perldoc/Text::CSV#print to write it as CSV, all quoted escaped and comma seperated

Re^11: Save form data with decoded URL chars
by Anonymous Monk on Aug 09, 2012 at 09:47 UTC