Ugh. It's a bug in SelfLoader. Look for the line that says:
It should say:croak("$callpack doesn't contain an __DATA__ token") unless fileno($fh);
Notice the "defined" test? In your system (and mine as well), when you close stdin (fileno 0), the C library reuses that file handle for the next usage - which is reading $0, which goes to *main::DATA. So the file number here is 0, which is false, and it croaks. What the author should have said is "check if there is a file number" - not that it's non-zero. (According to fileno, it returns undef if it's not open.)croak("$callpack doesn't contain an __DATA__ token") unless defined fileno($fh);
I suggest opening a bug against it and pointing to this thread. And then you can patch your own if you feel lucky ;-)
In reply to Re: SelfLoader chokes on closed STDIN
by Tanktalus
in thread SelfLoader chokes on closed STDIN
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |