A question about the dumplicated named global variables

Feng He <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hello,

Sorry I now have a queston about this case.

I have two PM for config options:

package Config1;
use strict;
require Exporter;

our @ISA = qw(Exporter);
our $example_var;
our @EXPORT = qw($example_var);

$example_var =1;

1;


package Config2;
use strict;
require Exporter;

our @ISA = qw(Exporter);
our $example_var;
our @EXPORT = qw($example_var);

$example_var =2;

1;


In the startup.pl I use both:

use Config1;
use Config2;

Now in the handler one the code is:

package Myhand1;
use Apache2::RequestRec ();
...
use Config1;

our $example_var;

sub handler {

     my $r = shift;
     handle_with($example_var);
}

1;


in the handler two the code is:

package Myhand2;
use Apache2::RequestRec ();
...
use Config2;

our $example_var;

sub handler {

     my $r = shift;
     handle_with($example_var);
}

1;


Finally my question is, since the global variable $example_var is 
defined in both packages Config1 and Config2, and exported by both them.
When I use Config1.pm in handler Myhand1, and use Config2.pm in handler 
Myhand2, will this get conflict? Will the two values of $example_var 
happen to override each other? Why this happens or not happpens?

Thanks in advance.

Regards.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.