Subject: | Some attempts at lexical scoping don't work as expected |
Hi,
Having read the doc and played a bit, I thought the following would work.
First I define a class:
package Spells;
use Export::Lexical
sub plugh :ExportLexical {
print "A hollow voice says 'PLUGH'.\n";
}
Then I tried the following:
sub stuff {
use Spells qw/ plugh /;
plugh(); # expect this to work
}
stuff();
plugh(); # expect this to fail
The first call to plugh(), from inside stuff(), works as expected.
The second call to plugh() silently does nothing, which was a bit surprising.
This feels like a bug, but it's possibly bug and some missing doc :-)
Cheers,
Neil