Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: More problems with CGI::Session

by oubiwann (Sexton)
on Mar 15, 2002 at 05:38 UTC ( [id://151907]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: More problems with CGI::Session
in thread More problems with CGI::Session

Yeah, I have used  use vars for global cgi stuff in the past. I definitely have to go with your suggestion about .pm's, though - that's such a great way to fly. But there's nothing that says you can't mix it all up - require, use vars, and .pm's! Bugzilla does :-) Man, I love that monstrosity. Sometimes when I'm bored, I like to just read through the crazy things those guys have done.

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

use vars qw {
(all your global variables here)
}
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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2025-01-22 17:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (63 votes). Check out past polls.