in reply to using modules already 'used'

I would create a module creating the cgi object and then <it>use</it> it in all modules requiring the cgi object. For instance something along the lines of:

package CGI::Instance; use strict; use CGI; use Exporter (); use vars qw(@ISA @EXPORT $cgi); @ISA = qw(Exporter); @EXPORT = qw( $cgi ); $cgi = new CGI; 1;

And then in A.pm and B.pm put a use CGI::Instance. This way, $cgi is only created once and is available both in A and in B.

Best regards

Antonio Bellezza