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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: global var
by tultalk (Monk) on Apr 06, 2017 at 21:46 UTC | |
by poj (Abbot) on Apr 07, 2017 at 13:29 UTC | |
|
Re^6: global var
by tultalk (Monk) on Apr 06, 2017 at 23:31 UTC | |
by poj (Abbot) on Apr 07, 2017 at 06:01 UTC | |
by Anonymous Monk on Apr 06, 2017 at 23:48 UTC | |
by tultalk (Monk) on Apr 07, 2017 at 22:24 UTC | |
by Anonymous Monk on Apr 07, 2017 at 23:23 UTC | |
by tultalk (Monk) on Apr 08, 2017 at 02:02 UTC | |
|