abc.pl #!/usr/bin/perl use lib "."; use A; use B; def(); ######################################## A.pm package A; require Exporter; @ISA = qw(Exporter); @EXPORT = qw( abc ); use B; sub abc{ print "Inside sub abc of package A\n"; } ######################################## B.pm package B; require Exporter; @ISA = qw(Exporter); @EXPORT = qw( def ); use A; sub def{ print "Inside sub def of package B -> calling sub abc from package A\n +"; abc(); }
In reply to loading modules using sub by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |