Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm not good at English, but I believe that when you look at codes you will understand what I meant
package AAA; use 5.20.1; use lib ('.'); use BBB; use parent('Exporter'); our @EXPORT=('$b','$msg'); our $bbb=BBB->new(); return 1; package BBB; use 5.20.1; use lib '.'; use AAA; sub new{ my $class=shift; my $self=bless {},$class; return $self; } sub hello{ my $self=shift; say 'hello'; } sub hello2{ my $self=shift; $b->hello(); } return 1; package main; use 5.20.1; use lib ('.'); use AAA; $bbb->hello2();
$ perl test.pl Global symbol "$bbb" requires explicit package name at test.pl line 5. Execution of test.pl aborted due to compilation errors.
|
|---|