hi all

with mp2 1.99_14,perl 5.8.5,apache 2.0.50
i have a problem of persistance.

I just print IP, time and pid.
when 2 computer get the script they sometimes see the have the same IP and the same time !


i would like all my variable aren't share
and especially the $user object

so could you tell me if i'm wrong or if it's a bug ?

thank's
Arnaud
#----------------------------------------------------------------------------------------------------------
#  test.pl
#----------------------------------------------------------------------------------------------------------
#!/usr/bin/perl

package Test;
use strict;
use CGI qw(:standard);
use lib('/home/GESINT/cgi-bin');


use My_module; my $user = My_module->new(ip=>$ENV{'REMOTE_ADDR'},pid=>$$);

&taff2();

sub taff2 {

print header();
print 'IP: ' . $user->ip . "<br>\n";
print 'PID: ' . $user->pid  . "<br>\n";
print 'TIME: ' . $user->dat  . "<br>\n";

 return 1;
}

1;

#----------------------------------------------------------------------------------------------------------
#  My_module.pm
#----------------------------------------------------------------------------------------------------------
package My_module;
use strict;

sub new {
 my $invoquant = shift;
 my $classe = ref($invoquant) || $invoquant;
 my $self = { @_ };
 bless ($self,$classe);

 $self->dat(time);

 return $self;
}

sub ip {
 my $self = shift;
 $self->{ip} = shift if @_;
 return $self->{ip};
};

sub pid {
 my $self = shift;
 $self->{pid} = shift if @_;
 return $self->{pid};
};

sub dat {
 my $self = shift;
 $self->{dat} = shift if @_;
 return $self->{dat};
};

sub DESTROY {
 my $self = shift;
};

#----------------------------------------------------------------------------------------------------------

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to