HI I have global var in main unit:

@EXPORT = qw( $LoggedOn_user_id $VERSION = '0.0.1'; } our $LoggedOn_user_id; my $username1 = $session->param("username"); warn("username1 : '$username1'"); my $text = $username1; $text =~ m/(\d+)/; my $num = $1; warn("num: '$num'"); $LoggedOn_user_id = $num; warn("is already logged on loggedon_user_id : '$LoggedOn_user_id'");

Above code works fine. $username1 from session is jala428. $num shows 428 as does $LoggedOn_user_id.

In another unit I have: use manageusers;

my $userid = 0; $userid = $manageusers::LoggedOn_user_id;

$userid in this unit shows 0. I have another global same main unit and pulling vatiable in another unit and works fine. Exact same method.

I did searches in all files in cgi directory after change to $userid_1:

my $userid_1 = 0; $userid_1 = $manageusers::LoggedOn_user_id; warn("userid : '$userid_1' "); #$userid_1 = 428; my $uid = $userid_1; my $uid = $userid_1;

All hits same file in question. No others. Fails with $userid_1 = 0;

Any observations/suggestions appreciated


In reply to global var by tultalk

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.