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