1package TestModule;
2
3use strict;
4require Exporter;
5use vars qw(@EXPORT @EXPORT_OK @ISA $IMPORTED);
6
7@ISA        = qw(Exporter);
8@EXPORT     = qw(func2);
9@EXPORT_OK  = qw(func1);
10
11### test if import gets called properly
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
25sub imported { $IMPORTED;       }
26
27sub func1    { return "func1";  }
28
29sub func2    { return "func2";  }
30
311;
32