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.


In reply to Re: Re: Re: Re: More problems with CGI::Session by oubiwann
in thread More problems with CGI::Session by fuzzyping

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.