Been sick.
Back to this You siad to add this:
{ 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; } }
What is it supposed to do? Error below:
Can't opendir /usr/local/apache/lib/perl: No such file or directory a +t update_tables-development.cgi line 38. Tue Apr 11 11:26:22 2017 upd +ate_tables-development.cgi: Can't opendir /usr/local/apache/lib/perl: + No such file or directory at update_tables-development.cgi line 38.
Also i have checked $LoggedOn_user_id in the code block for existing user loged on and new user login and in both cases $LoggedOn_user_id contains the value I expect. In neither case is $LoggedOn_user_id undefined or 0.
The value is not passed across the boundary between the pm and the cgi script that calls for the value.
You state: you dont check to see if $session->id() ne $sid. If they are not the same it is because either the $sid never existed or that session has expired.
The $sid/session id is from the cookie. If the cookie expired then a new session is created. Both cases are addressed.
The problem lies in my lack of understanding of the scope of variables and their persistence.
running in padre still shows the variable in not exported by manageusers.
In reply to Re^21: global var
by tultalk
in thread global var
by tultalk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |