in reply to Re^2: Export global variables not working correctly
in thread Export global variables not working correctly

In your function hello2() you need to call hello() function with $self not with $bbb, as $self already has the BBB package object.

sub hello2{ my $self=shift; #$bbb->hello(); $self->hello(); }

All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^4: Export global variables not working correctly
by Anonymous Monk on Mar 06, 2015 at 06:33 UTC

    I know but that is differnt instance
    What I'm trying to do is to invoke method $AAA::bbb->hello() , but without prefix AAA:: .
    in package main I can invoke $AAA::bbb->hello() without prefix, but I can't in another package like BBB because of error saying " Global symball $bbb requires explicit package name".
    The error is still same if I make another package CCC and invoke $AAA::bbb->hello() without prefix in package CCC.