1package TestModule; 2 3use strict; 4use warnings; 5 6require Exporter; 7use vars qw(@EXPORT @EXPORT_OK @ISA $IMPORTED); 8 9@ISA = qw(Exporter); 10@EXPORT = qw(func2); 11@EXPORT_OK = qw(func1); 12 13### test if import gets called properly 14sub import { $IMPORTED = 1; 15 ### this breaks on 5.8.[45] which have a bug with goto's losing 16 ### arguments in @_. This is the cause of the 0.14 tester failures 17 ### under 5.8.[45]. The bug is NOT in exporter, but core perl: 18 ### http://testers.cpan.org/show/Module-Load.html 19 #goto &Exporter::import; 20 21 ### instead, use the undocumented, but widely used $ExportLevel 22 ### which will make sure we pass all arguments, and even works 23 ### on buggy 5.8.[45] 24 do { local $Exporter::ExportLevel += 1; Exporter::import(@_) } 25 } 26 27sub imported { $IMPORTED; } 28 29sub func1 { return "func1"; } 30 31sub func2 { return "func2"; } 32 331; 34