IN the code that does show that $LoggedOn_user_id is not exported by manageusrs. put this in right after your use manageusers qw($LoggedOn_user_id); statement
and see what your error log says. Be careful to cut and past all of that code, right click on download and select save file as and cut it all from that file you downloaded. Then do it in your sample program above too, and compare the warnings you get from both, remember order in the error log matters! Cut and paste the warnings from both the sample and the real program back here.{ use strict; use warnings; my %wanted; $wanted{manageusers}=1; for my $inc (@INC) { opendir (my $dh,$inc) || warn "Can't opendir $inc: $!"; while (my $file=readdir $dh) { if ($file=~m/(.*)[.]pm$/) { if ($wanted{$1}) { warn 'found:'.$inc.'/'.$file; } } } closedir $dh; } }
and saying And later I populate the variable with the desired data is easy, proving it is not as easy. So cut and paste ALL of manageusers::OpenConnection() and ALL of every subroutine it calls to prove that you do set $manageusers::LoggedOn_user_id properly every time and dont set it back to zero somewhere else.
In reply to Re^16: global var
by huck
in thread global var
by tultalk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |