Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: carrying a lot of vars from page to page with hidden()

by solri (Initiate)
on Feb 01, 2003 at 01:31 UTC ( [id://231778]=note: print w/replies, xml ) Need Help??


in reply to carrying a lot of vars from page to page with hidden()

A question that might be related. If I run a CGI program using a subroutine for each page, normally variables from one subroutine/page will not be available to the other subroutines, which is the way Perl works, of course. However, if I access these variables by using something like print somesubroutine($variable) it doesn't play nice with CGI.pm - instead of returning post data, pages after the second just print the submit button again. (current state of the program is lists.bilkent.edu.tr/~robin/cgibin/tester.cgi.)

Originally posted as a Categorized Answer.

Replies are listed 'Best First'.
Re: Re: carrying a lot of vars from page to page with hidden()
by Ryszard (Priest) on Feb 01, 2003 at 08:38 UTC
    This is not really the way perl works as such, but more along the lines of the stateless nature of HTTP.

    There are numerous ways to maintain state that include:

    1. Tied hash
    2. A database
    3. regular old file
    4. hidden fields in the page...
    In fact any method of retrieving the data can be used. The interesting part of maintaining state come along when you want to retrieve the data associated with a particular "session". You have to work out a method of branding the browser, then retrieving that branding and associating it with the data you've stored server side.

    There are three main methods of branding a browser, cookies, in the URL and using hidden variables in your pages...

    I wont go into detail, however, there is a wealth of information available all over the web, and here on perl monks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://231778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2024-04-23 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found