in reply to How to declare global variable in CGI file?

You mean a single variable across multiple scripts? That is certainly not possible. If you need such thing you will have to store the value in a file or a database of some kind.


holli, /regexed monk/
  • Comment on Re: How to declare global variable in CGI file?

Replies are listed 'Best First'.
Re^2: How to declare global variable in CGI file?
by waswas-fng (Curate) on Jun 28, 2005 at 14:50 UTC
    If it is per session you may use a cookies and CGI::Session to tuck data away that is usable via all the cgi scripts that know about the session store. Else if you just want to load up default config vars in your cgi scripts you may use a require on each script that loads a config.pl file that has all of your global config vars present. If you just want to share a writable var between processes look at IPC::Shareable. Not very pretty -- but certainly doable.


    -Waswas