#Foo.pm use strict; use warnings; package Foo; use Foo_1.pm; use Foo_2.pm; # Foo_1.pm use strict; use warnings; package Foo; my $HELLO; our $GOODBYE; sub hello { return "Hi!"; } # Foo_2.pm use strict; use warnings; package Foo; #note: also package Foo #$HELLO='Bonjour' #compiler complains - see below for why $Foo::HELLO='Bonjour'; #this is OK - see below for why #$GOODBYE='Au revoir' #compiler complains - see below for why $Foo::GOODBYE='Au revoir'; #this is OK - see below for why # calling hello() without qualification is OK, so long # as the package is Foo (which it is) print hello() . ": Hello=$Foo::HELLO, Goodbye=$Foo::GOODBYE\n";