### XXA.pm ###
package XXA;
BEGIN { print ((" " x $main::x++) . "Beginning XXA compile\n") }
use strict;
#BEGIN
{
use Exporter;
use vars qw( @ISA @EXPORT );
@ISA = qw( Exporter );
@EXPORT = qw( xxa );
}
use XXB;
BEGIN { print ((" " x $main::x) . "Just used XXB in XXA compile\n") }
sub import {
my ($self) = shift;
print ((" " x $main::x) . "XXA->import called\n");
$self->export_to_level(1, @_);
}
sub xxa {
xxb;
}
BEGIN { print ((" " x --$main::x) . " Finishing XXA compile\n") }
1;
### end XXA.pm ###
####
### XXB.pm ###
package XXB;
BEGIN { print ((" " x $main::x++) . "Beginning XXB compile\n") }
use strict;
#BEGIN
{
use Exporter;
use vars qw( @ISA @EXPORT );
@ISA = qw( Exporter );
@EXPORT = qw( xxb );
}
use XXA;
BEGIN { print ((" " x $main::x) . "Just used XXA in XXB compile\n") }
sub import {
my ($self) = shift;
print ((" " x $main::x) . "XXB->import called\n");
$self->export_to_level(1, @_);
}
sub xxb {
xxa;
}
BEGIN { print ((" " x --$main::x) . " Finishing XXB compile\n") }
1;
### end XXB.pm ###
####
me@host> perl -c XXA.pm
Beginning XXA compile
Beginning XXB compile
Beginning XXA compile
Just used XXB in XXA compile
Bareword "xxb" not allowed while "strict subs" in use at XXA.pm line 26.
BEGIN not safe after errors--compilation aborted at XXA.pm line 29.
BEGIN failed--compilation aborted at XXB.pm line 15.
BEGIN failed--compilation aborted at XXA.pm line 15.
me@host:>
####
me@host> perl -c XXA.pm
Beginning XXA compile
Beginning XXB compile
Beginning XXA compile
Just used XXB in XXA compile
Finishing XXA compile
XXA->import called
Just used XXA in XXB compile
Finishing XXB compile
XXB->import called
Just used XXB in XXA compile
Finishing XXA compile
XXA.pm syntax OK
me@host>
####
------------
:Wq
Not an editor command: Wq