Test Program Error Log

Can' find the log Padre file

Real Program Error log:

found:/home/jalamior/www/httpsdocs/cgi-bin/lib/perl/manageusers.pm at update_tables-development.cgi line 41. Tue Apr 11 11:26:22 2017 update_tables-development.cgi: found:/home/jalamior/www/httpsdocs/cgi-bin/lib/perl/manageusers.pm at update_tables-development.cgi line 41. Can't opendir /usr/local/apache/lib/perl: No such file or directory at update_tables-development.cgi line 38. Tue Apr 11 11:26:22 2017 update_tables-development.cgi: Can't opendir /usr/local/apache/lib/perl: No such file or directory at update_tables-development.cgi line 38.

Line 30 use manageusers qw($LoggedOn_user_id); { 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; } }

You say: 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.

I don't understand the question. Search all fdiles on manageusers::OpenConnection(); yields 10 hits.

manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection(); manageusers::OpenConnection();

They all call the same function

#--------------------------------------------------------------------- +---------- # Database Conection Functions #--------------------------------------------------------------------- +---------- # FUNCTION: OpenConnection() # DESCRIPTION: Connect to the MySQL database #--------------------------------------------------------------------- +---------- sub OpenConnection { my $localtimenow = localtime(Now()); $dbh = DBI->connect($dsn,$sql_username,$sql_password) or ErrorMessage("Could not connect to the database."); warn("Open Connection-JustBefore returning database handle: '$dbh' + Current Time: '$localtimenow'"); return $dbh; }

You say: prove that you do set $manageusers::LoggedOn_user_id properly every time and dont set it back to zero somewhere else

It is oly populated at two places. For a new logged on user it gets the id from the session table. For an already logged on user (cookie expires 7 days) it get the ID from the session table based on the SID lookup.

New login warn("Hash evaluation succeded - $passhash = $passhash1 : $sessiondata +2 = $sessiondata2md5p"); my $timein = time(); $session->param('user_id',$uid); $session->param('username',$username); $session->param('forename', $forename); $session->param('lastname', $lastname); $session->param('timein', $timein); $session->param('timeout', 0); $session->param('attempts',0); $session->param('isloggedin',1); $session->expires('+7d'); $LoggedOn_user_id = $uid; #$session->param("user_id");
Already logged on if ($status == 1) { warn("Process Login returning after confirmed already logged in: s +tatus: '$status' sessionname: '$sessionname' SID: '$sid'"); my $username1 = $session->param("user_id"); warn("username1 : '$username1'"); $LoggedOn_user_id = $username1; warn("Already logged on LoggedOn_user_id : '$LoggedOn_user_id'");

In reply to Re^17: 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.