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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.