http://www.perlmonks.org?node_id=1187325


in reply to Re^4: global var
in thread global var

In your original post you wrote 'I have global var in main unit:' and 'In another unit I have: use manageusers;'

What do you mean by 'unit' ?. Do you have the same variable name declared in both the cgi script and the manageuser module something like this

# cgi script use strict; our $LoggedOn_user_id = 0; # # # use manageusers qw($LoggedOn_user_id); print $LoggedOn_user_id;
# package package manageusers; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw( $LoggedOn_user_id ); our $LoggedOn_user_id = 123; 1;

The code prints 0 not 123

poj