in reply to Re^27: global var
in thread global var
If you add a subroutine into manageusers.pm like this
sub getLoggedOn_user_id { my ($dbh,$query) = @_; my $session = CGI::Session->load( "driver:MySQL", $query, { Handle => $dbh } ); return $session->param("user_id"); }
then only change in your script is from
$userid_1 = $manageusers::LoggedOn_user_id;to
$userid_1 = manageusers::getLoggedOn_user_id($dbh,$q);One less 'global' to worry about
|
|---|