I stumbled upon an unexpected side-effect of using the autoloader, as demonstrated using the two attached .pdl files. To see the problem, run
Patch to NiceSlice.pm for the immediate problem.
Simple test .pdl file, to be autoloaded, used by the driver script.
Driver script tha demonstrates the problem. See the firs comment for details.
Sorry about that stub. I was attempting to upload a file before finishing the statement and it thought I had said everything already!
Here's the deal. Put test.pdl and testSub.pdl in your Autoloader directory. Then call test() from the perldl prompt. Somewhere in the output, you should get something about "sub testSub...", i.e. the contents of testSub.pdl! I'll let the code speak for itself; it's not terribly long or complicated. Notice that if you run it a second time, you won't have the contents of testSub.pdl printed.
The upshot is that NiceSlice is using $_ without localizing it. Under these circumstances, it happens in the eval block in NiceSlice.pm that begins on line 386. The patch file adds a single line of code that localizes $_.
However, as the second half of the test script shows, this problem happens WHENEVER a subroutine modifies $_ without localizing it, which seems to suggest that all library code needs to localize $_. :(