@ISA is used as a package global. It also happens to be how Perl keeps track of inheritance. Now you may mostly be able to ignore that it's being used, by using the base or parent pragmas, but it's still there if your package inherits from something.

So if "building any of the big Tool" includes building classes that inherit from other classes, you can't avoid using package globals.

If you tried using "my @ISA", it just wouldn't work out; the inheritance chain needs to be recorded in the symbol table, not the lexical pad, because that's where Perl will go looking for it.

Even a module that just exports its functions will usually rely on Exporter by saying something like, "our @ISA = qw( Exporter );... and at that point you're committed to using other globals like @EXPORT and/or @EXPORT_OK.

The justification is that this is how it's done. You shouldn't need more justification than "because that's how it's done, and it generally works."

Now if your question is asking about some other application of package globals, you'll need to be more specific. The symbol table is a powerful device, but not always the only (or even the right) tool for a given job. The barometer for justification in the more general case should be (1) Is it maintainable? (2) Does it work? (3) Is it the simplest approach?


Dave


In reply to Re: Global Variables and Pointer(Reference). by davido
in thread Global Variables and Pointer(Reference). by raaj

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.