in reply to Re: mod_perl and multi user environment - clashes with other users's data
in thread mod_perl and multi user environment - clashes with other users's data

hi,
Even after using "our" keyword, im facing problem with my code. with that sample your solution works fine. but please check whats wrong in my code,
#! /usr/cisco/bin/perl -w #use strict; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use HTML::Template; use Data::Dumper; use hiGuiStatus; # my own module # send the obligatory Content-Type print "Content-Type: text/html\n\n"; #$q = new CGI; #print $q->Dump(); our $status = hiGuiStatus->new(); our $userid = $status->get_ldap_user_name(); print $userid; my $err_msg; ($err_msg, %hoh) = $status->read_file($userid); #print Dumper \%hoh; if(param('sort')) { my $sort_sel = param('sort_option'); ($err_msg, @sort_keys) = $status->jobs_sort($sort_sel); #print $err_msg; } if(param('terminate')) { my @del_ids = param('check_del'); ($err_msg) = $status->jobs_terminate(\@del_ids, $userid, \%hoh); ($err_msg, %hoh) = $status->read_file($userid); } if(param('publish')) { my $ddts = param('ddts_no'); my @del_ids = param('check_del'); $status->jobs_publish($ddts, \@del_ids); } if(param('delete')) { my @del_ids = param('check_del'); ($err_msg) = $status->jobs_delete(\@del_ids, $userid, \%hoh); ($err_msg, %hoh) = $status->read_file($userid); } @loop = $status->jobs_loop(); #print Dumper \@loop; my $template = HTML::Template->new(filename => 'hiGuiStatus.tmpl'); # call param to fill in the loop with the loop data by reference. $template->param(err_msg => $err_msg, job_loop => \@loop); # print the template print $template->output;

Basically this code does retrieve data from a text file for a particular user who has logged in and display it using HTML::Template.
I used the keyword "our" and still face the problem of other user's data being displayed in my browser, ONLY IN mod_perl

thanks
rsennat
  • Comment on Re^2: mod_perl and multi user environment - clashes with other users's data
  • Download Code