in reply to Storing sequence of cgi states

You could use an array to store a list of all page views.
Store it in the url (or as a hidden field) as a single param,
?history=view1,view2,view3 Then when the script is invoked, turn this param into an array.
my ($q, %param, @history); use CGI; $q = new CGI; %param = $q->Vars; if (defined $param{history}) { @history = split(',', $param{history}); }
Now you have a @history array which lists all previous 'pages' viewed.
To add another onto the end (which you must do to keep the list updated for every view.) you could do something like,
push @history, $param{view_page} And make sure you add the updated history list back to the url (or hidden field) for every link in the new page you display.
my $history = join(',', @history); my $page1url = $q->url(-absolute=>1) . '?history=' . $history&view_page=view1; my $page2url = $q->url(-absolute=>1) . '?history=' . $history&view_page=view2;

The examples above are just to explain the theory. Listen to the above advice by charnos and rdfield regarding wider application design, and at the very least make sure you TAINT check the input before doing anything with it.

You'll also have to think about things such as,
if the user follows a link you create named 'back' from View3 to View2, you'll have a list like this view1,view2,view3.
Do you then add view2 to the end, giving you view1,view2,view3,view2?
or do you pop view3 off, giving you view1,view2?

This kind of stuff can get messy real fast, so plan well!
If you're going to use this to force users along a certain route, that's ok (?!), but if you want to provide back links, here's an article by Abigail which explains why back links with HTML and CGI generally don't work, you'll find it here, http://www.foad.org/~abigail/HTML/Misc/back_button.html