in reply to Re: Re: Re: More problems with CGI::Session
in thread More problems with CGI::Session
Update
I've thought about this for a couple days... you are not going to use modules, and you will have one main script, some required scripts, and you want to have global variables.
Well, to make a variable truely global in perl, you just declare it with no 'my': $your_var = "something cool"; If you don't want to get scope warnings, just do $::your_var or $main::your_var. This means that you will be using package variables, not lexical variables (like 'my' or 'our'). Again, for clarity's (and your sanity a few months from now) sake you might want to refer to these with $main:: or $::, since that is the default package you will be using... and as soon as you see these you will know what they are.
The other option (which might not be as clear a few months after you finish your project) would be to do 'use strict' and then do
(all your global variables here)use vars qw {
Like I said, I have done this in the past, but I don't think I would do it now.}
Man, I hope this is clear; I'm not good at expressing this kind of thing - unfortunately, I am an intuitive programmer. Let us know how it goes.
|
|---|