Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exporting a empty sub using :from<perl5> works.
- Loading branch information
Paweł Murias
committed
Feb 21, 2012
1 parent
ea24f5c
commit 3da37be
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
package Niecza::Interoperability; | ||
#BEGIN {print "ok 1 # loaded Niecza::Interoperability\n"} | ||
use v5.10; | ||
use Package::Stash; | ||
my $id = 0; | ||
sub use_module { | ||
my ($module) = @_; | ||
my $stash = Package::Stash->new('Niecza::Stash::Interopability::TMP'.$id++); | ||
eval("package ".$stash->name.";use $module;"); | ||
warn $@ if $@; | ||
my @subs = $stash->list_all_symbols('CODE'); | ||
for my $symbol (@subs) { | ||
say "importing sub $symbol from $module"; | ||
} | ||
$subs[0]; | ||
} | ||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters