in reply to Saving CGI state to mySQL
you can also look into perltie and tutorials to tie a filehandle to a scalar, but I think it'd be easier to adopt the above code.#### Method: save # Write values out to a filehandle in such a way that they can # be reinitialized by the filehandle form of the new() method #### 'save' => <<'END_OF_FUNC', sub save { my($self,$filehandle) = self_or_default(@_); $filehandle = to_filehandle($filehandle); my($param); local($,) = ''; # set print field separator back to a sane value local($\) = ''; # set output line separator to a sane value foreach $param ($self->param) { my($escaped_param) = escape($param); my($value); foreach $value ($self->param($param)) { print $filehandle "$escaped_param=",escape("$value"),"\n"; } } foreach (keys %{$self->{'.fieldnames'}}) { print $filehandle ".cgifields=",escape("$_"),"\n"; } print $filehandle "=\n"; # end of record } END_OF_FUNC
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
|
|---|