Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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

by solri (Initiate)
on Feb 01, 2003 at 01:31 UTC ( #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 - instead of returning post data, pages after the second just print the submit button again. (current state of the program is

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2023-05-30 18:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found