as $::Config or $main::Config
if you have to call it inside a module.
I've tested your code like this:
#!/usr/bin/perl -w
use strict;
use CGI ();
$::Config = CGI->new;
our $Config;
require "req.pl";
require Req;
package Test;
printf "Test: %s-%sn", ref($Config),ref($::Config);
req.pl
printf "req: %s-%sn", ref($Config),ref($::Config);
1;
Req.pm:
package Req;
printf "Req: %s-%sn", ref($Config),ref($::Config);
1;
output:
quote:
req: CGI-CGI
Req: -CGI
Test: CGI-CGI
inside a file you can use it in all packages, but if you use() or require() a module you cant... It also works on simple code files...