in reply to BEGIN { use Exporter; ...
Avoiding the circular dependency is the better solution, of course.
Update: My bad, I incorrectly started A's state when C calls A->import. At that point A has been compiled up to the use B; line and not executed. So you want the BEGIN block to be before that. The purpose of the construct is the same, though.
An alternate solution is to have A:
This is in many ways superior because when C calls A you will have A completely compiled, if not yet executed.require B; B->import(qw(some stuff if desired));
|
|---|