in reply to Saving state in cgi.pm question
You appear to have a either a closure or global variables on $query, $file, and %list. Under various conditions you may get unexpected results. It is better practice to pass values to subroutines as arguments.
I added some error checking on the save operations, so you get better information if something there is the problem.sub printboxes { my ($query, $file, %list) = @_; # ... open FH, '> ' . $file or die $!; $query->save(FH) or die $!; close FH or die $!; }
Update: The data you get saved suggests that $query does not have any data in it. Could be the kind of unexpected behavior I mentioned. Or do your test runs neglect to provide data?
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Saving state in cgi.pm question
by Popcorn Dave (Abbot) on Nov 25, 2002 at 07:07 UTC |