tultalk has asked for the wisdom of the Perl Monks concerning the following question:

Never mind. Ignore this post. I am having difficulty keeping track of what I am doing. I have a duplicate of website on local machine. I was using hosts to keep from accessing files on line but what a horror having to change hosts when I want to go to the live site. Got screwed up as to what file I was using. Sorry. This is wrong thread. Could not find link to start a new one. Went from compile error to software error. Problem with sendmail. Trying to block out section of code for testing Ttried the = for comments and =cut Didn't work Tried # on every line. Didn't work?? Error before comment out # Same after all the # Global symbol "$mailprog" requires explicit package name at /home/jalamior/www/cgi-bin/lib/perl/manageusers.pm line 777.
#my $mailprog = '/usr/lib/sendmail -oi'; #my $mailprog = '/usr/lib/sendmail -oi -t'; #my $mailprog = '/usr/sbin/sendmail -oi -q -t'; # FUNCTION: open_sendmail_pipe($fh, $mailprog) # my ($fh, $mailprog) = @_; # $result = open $fh, "| $mailprog" #$result = open $fh, "| $mailprog"; #die "Can't open $mailprog\n" unless $result; # open_sendmail_pipe(\*MAIL, $mailprog); #close (MAIL) || die "close mailprog: \$?=$?,\$!=$!";
Suggestion from monks =for comment die "testing"; =cut All the code between =for comment and =cut dimmed out. Same with all the # but still error message: Global symbol "$mailprog" requires explicit package name at /home/jalamior/www/cgi-bin/lib/perl/manageusers.pm line 777. No instances of "$mailprog" exist which are not commented out. Help!!!!!

Replies are listed 'Best First'.
Re: Switch.pm Failure ( CGI::Switch? )
by poj (Abbot) on Feb 26, 2017 at 16:14 UTC

    Is that code from manageusers.pm ?. If so, what are the line numbers.

    poj
      Hi Again. When I open jala-mi.org and it calls a login form inside an iFrame (the first item in the old switch tree and the new tree w/out switch, the form comes up fine and the activity (warn) is posted to the server error log. When I submit the form to log in, no response and nothing in server log. This serves the login form per request:
      Main(); sub Main { my $action = $query->param('action'); { warn("manage_users.cgi line 63: '$action'"); warn("Request from User for Login Form"); ($action eq "GetLoginForm") && do { manageusers::OpenConnection(); warn("process login request - create session"); my ($result,$message0,$message1,$message2) = ProcessLoginReque +st($query); if(!$result){ warn("Tell client that login failed"); manageusers::CloseConnection(); LoginUserFailedForm("The Login Request failed. Please try a +gain or contact the office."); return; #exit; } elsif ($result == 1) { #Client already logged in so tell them manageusers::CloseConnection(); CreateAlreadyLoggedinForm($message0); return; } elsif ($result == 2){ warn("Not logged in so send client login form"); manageusers::CloseConnection(); CreateLoginForm($message0, $message1, $message2); return; #exit; } };
      Below follow on submittal request does not elicit a response the the as shown in the server log.Nothing at all.
      #Login User ($action eq "LoginUser") && do { #Attempt the login manageusers::OpenConnection(); warn("Opening The Login Usr Query: $query"); my ($result, $login_timeout) = LoginUser($query); if ($result == 0){ manageusers::CloseConnection(); warn("Login failed. Creating response."); CreateLoginUserFailedForm("The Login User Name or Password +is invalid. Please try again or contact the office."); return; #exit; } elsif ($result == 1){ #Client already logged in so tell them manageusers::CloseConnection(); warn("Alrrady logged in."); CreateAlreadyLoggedinForm("You are already logged in."); return; #exit; } elsif ($result == 2){ manageusers::CloseConnection(); warn("Login failed. Membership expired."); CreateLoginUserFailedForm("Your Membership Has Expired. To r +enew membership, use the form on this site or contact the office."); return; #exit; } elsif ($result == 3) { manageusers::CloseConnection(); warn("Login succeeded. Creating response."); CreateUserLoginSucceededForm("Login succeeded."); return; #exit; } elsif ($result == 4){ manageusers::CloseConnection(); warn("Login failed.Max attemps response."); CreateLoginUserMaxAttemptsFailedForm("Maximum allowed number + of login attempts exceeded for session. Please contact the office.") +; return; #exit; } elsif ($result == 5){ manageusers::CloseConnection(); warn("Login failed. Timeout."); CreateLoginUserFailedForm("The '$login_timeout' second Login + window has expired. Please try again or contact the office"); return; #exit; } else { manageusers::CloseConnection(); warn("Login failed. Unknown reason."); CreateLoginUserFailedForm("Login failed for unknown reasons. + Please contact the office."); return; #exit; } return; #exit; };
      You can see the request form in the iFrame source. Back to the if else tree??

        In the source at at https://www.jala-mi.org/httpsdocs/cgi-bin/manage_users.cgi?action=GetLoginForm there is a line:

        <input type="button" value="Login" id="submit" style="background-color +:#0D4A80; color:#fff"; onclick="validate()"/>
        but i cannot find a validate subroutine and my firefox console shows "ReferenceError: validate is not defined". This is not an error in the perl, but of the html/javascript. When you press the login button the browser does does not send anything back to the server to process but instead raises the error condition in the console.

        After you click the login button you dont see the result of warn("manage_users.cgi line 63: '$action'"); in the log?