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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |