> This does seem to be my problem -- the POD data is missing from my
> packaged Net/LDAP/Constant.pm. Is there a way I can prevent it from
> being stripped?
Turns out this is a problem with PAR::Filter::PodStrip when
- the filtered file is in DOS (CR-LF) format
- contains a __DATA__ section that consists of POD
(e.g. Net/LDAP/Constant.pm)
Then the filter will mangle the __DATA__ section
(replace it with a single #line directive).
The reason is:
- PAR::Filter slurps the file with $/=undef and in binmode,
hence its contents will contain CR-LFs, esp the substring
"...\015\012__DATA__\015\012..."
- PAR::Filter::PodStrip uses
$data = $1 if $$ref =~ s/((?:^__DATA__$).*)//ms;
to strip and extract the __DATA__ section from the contents
(which it will re-append to the rest after filtering it).
But /^__DATA__$/ doesn't match the above substring because
"$" only matches \012 (regardless whether we're on Windows or Unix).
Patch (vs PAR 0.89):
--- PAR/Filter/PodStrip.pm.orig 2005-07-20 15:39:45.265625000 +0200
+++ PAR/Filter/PodStrip.pm 2005-07-20 15:37:08.656250000 +0200
@@ -25,7 +25,7 @@
no warnings 'uninitialized';
my $data = '';
- $data = $1 if $$ref =~ s/((?:^__DATA__$).*)//ms;
+ $data = $1 if $$ref =~ s/((?:^__DATA__\r?\n).*)//ms;
my $line = 1;
if ($$ref =~ /^=(?:head\d|pod|begin|item|over|for|back|end|cut)\b/) {
Cheers, Roderich