Nicholas Clark <[EMAIL PROTECTED]> writes:
> On Thu, Apr 27, 2006 at 10:14:07AM -0700, Russ Allbery wrote:
>> Nicholas Clark <[EMAIL PROTECTED]> writes:
>>> Did anything come of this?
>>> I was wondering what subtle but known differences exist between the
>>> behaviour of the POD modules in 5.8.8, and those in blead.
>> I was going to look at Yitzchak's message in detail with an eye to
>> implementing a compatibility layer in the podlators modules, but I
>> haven't had a chance yet.
> Would some help be useful here?
> I've held back merging the new POD modules to 5.8.x because I know that
> there are currently a few things that doing so would break, and I was
> hoping that it wouldn't be that hard to emulate the last few features.
That would be great. I think that most of the remaining issues are best
addressed in Pod::Simple, but I may be incorrect about that. I
unfortunately haven't had much time to work on podlators for a while and
probably won't have a lot of time in the near future.
The main thing left that will bite people is:
Pod::Parser would close the input or output file if it opened it
itself rather than being passed a handle.
I can't see any easy way for Pod::Man or Pod::Text to simulate this
behavior, since only Pod::Simple really knows whether or not it opened a
file handle itself or was passed in one.
Here's the patch that Yitzchak wrote against Pod::Simple. I don't know if
this was applied, although since the current version is still 3.04, I
assume not. The original explanation was:
Here are some Pod::Simple changes that fix a few differences from what
Pod::Parser did: allow any kind of object that has a getline() method,
prevent output filenames beginning &,>, from being special, preserve
special STDERR handling. Also specify INSTALLDIRS=perl in Makefile.PL
when appropriate.
--- Pod-Simple-3.04-orig/lib/Pod/Simple.pm 2006-01-16 17:49:38.000000000
-0800
+++ Pod-Simple-3.04/lib/Pod/Simple.pm 2006-02-19 17:57:13.703125000 -0800
@@ -407,13 +407,17 @@
# By here, $source is a FH.
$self->{'source_fh'} = $source;
-
+
+ # Use <$fh> instead of $fh->getline where possible (for speed)
+ my $diamondop = ref($source) =~ /^(?:GLOB|FileHandle|IO::\w+)$/
+ || eval { tied *$source };
+
my($i, @lines);
until( $self->{'source_dead'} ) {
splice @lines;
for($i = MANY_LINES; $i--;) { # read those many lines at a time
local $/ = $NL;
- push @lines, scalar(<$source>); # readline
+ push @lines, scalar($diamondop ? <$source> : $source->getline); #
readline
last unless defined $lines[-1];
# but pass thru the undef, which will set source_dead to true
}
@@ -448,11 +452,13 @@
or $to eq '-' or $to =~ m/^>&?(?:STDOUT|1)$/i
) {
$self->output_fh( *STDOUT{IO} );
+ } elsif($to =~ m/^>&?(?:STDERR|2)$/i) {
+ $self->output_fh( *STDERR{IO} );
} else {
require Symbol;
my $out_fh = Symbol::gensym();
DEBUG and print "Write-opening to $to\n";
- open($out_fh, ">$to") or Carp::croak "Can't write-open $to: $!";
+ open($out_fh, "> $to") or Carp::croak "Can't write-open $to: $!";
binmode($out_fh)
if $self->can('write_with_binmode') and $self->write_with_binmode;
$self->output_fh($out_fh);
--- Pod-Simple-3.04-orig/Makefile.PL 2004-05-24 01:21:20.000000000 -0700
+++ Pod-Simple-3.04/Makefile.PL 2006-02-19 18:08:20.687500000 -0800
@@ -15,7 +15,8 @@
NAME => 'Pod::Simple',
VERSION_FROM => 'lib/Pod/Simple.pm',
ABSTRACT_FROM => 'lib/Pod/Simple.pod',
- # INSTALLDIRS => 'perl',
+ ($] >= 5.009003 ?
+ (INSTALLDIRS => 'perl') : ()),
PREREQ_PM => {
'Text::Wrap' => '98.112902',
'Pod::Escapes' => '1.04',
--
Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/>