This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Unicode::Normalize from version 1.19 to 1.21
[perl5.git] / cpan / Module-Load / t / to_load / TestModule.pm
1 package TestModule;
2
3 use strict;
4 require Exporter;
5 use 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
12 sub 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              
25 sub imported { $IMPORTED;       }
26
27 sub func1    { return "func1";  }
28
29 sub func2    { return "func2";  }
30
31 1;