I have a couple of questions.

1.) Why are you defining variables in one package to export to another, when it is just as easy to define them in the program? You can always use Exporter to help you.

Sample: (untested)

package COMMON::AUTH; use strict; use Exporter; @COMMON::AUTH::ISA = qw(Exporter); our ($user,$admin); @EXPORT = qw($user $admin); $user = $ENV{'REMOTE_USER'}; $admin = 'admin'; 1;
2.) In the earlier code sample, COMMON::AUTH is designed to be used as a module (with use or require). You might want to rethink your design. Why put "global" variables into a perl (.pl) file? Why not just define them in every script; or better yet, make small subs in your COMMON::AUTH module that return specific data. For example:
package COMMON::AUTH; use strict; use Exporter; @COMMON::AUTH::ISA = qw(Exporter); @EXPORT = qw(user admin); sub user { return $ENV{'REMOTE_USER'}; #Make sure to untaint this data just i +n case } sub admin { return 'admin'; } 1;
The cool thing about using subs to return this (fairly trivial) data is that you can do some other processing (for example, untainting) before you return.

Theodore Charles III
Network Administrator
Los Angeles Senior High
4650 W. Olympic Blvd.
Los Angeles, CA 90019
323-937-3210 ext. 224
email->secon_kun@hotmail.com
perl -e "map{print++$_}split//,Mdbnr;"

In reply to Re: supress an error by Necos
in thread supress an error by nlafferty

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.