in reply to CGI.pm saving state to database

save() won't do what you want in this context most probably - but you can create a new CGI object from an existing one so what you probably want to do is rather than use save() you serialize the CGI object (using Data::Dump, Storable, Data::DumpXML or whatever) and then store the serialized data in the database. Then when you want to get it back you can deserialize it into a variable and then pass that to CGI->new(). An example using Storable (omitting the database bit):
#!/usr/bin/perl -w use strict; use CGI; use Storable qw(freeze thaw); my $cgi1 = CGI->new(); # do some stuff my $save_cgi = freeze($cgi1); # # save $save_cgi to a database # time passes and you get it back into $save_cgi # (this is possibly in another process my $restore_cgi1 = thaw($save_cgi); my $cgi2 = CGI->new($restore_cgi1);
You should be extremely cautious when deserializing data from a database and ensure that the permissions do not allow people to put random stuff into the table that could be deserialized in such a way that it could potentially be harmful. Hope that helps
/J\