use CGI; my $q = new CGI; # to save object to a database as a single string my $string = $q->query_string(); save_to_db($string); # to retrieve object just get the string back my $string = get_from_db(); # and use it to initinalise a new CGI object my $reconstituted_q = new CGI($string);