delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/18/09:07:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <41ECDED5.2060300@x-ray.at>
Date: Tue, 18 Jan 2005 11:03:01 +0100
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7) Gecko/20040616
MIME-Version: 1.0
To: pod-people AT perl DOT org
CC: David Christensen <dpchrist AT holgerdanske DOT com>, perlbug AT perl DOT org,
cygwin <cygwin AT cygwin DOT com>
Subject: Re: FW: Cygwin Perl bug -- pod2usage(-verbose => 0) & pod2usage(-verbose => 1)
References: <200501180337 DOT j0I3bcx4016479 AT a DOT mail DOT sonic DOT net>
In-Reply-To: <200501180337.j0I3bcx4016479@a.mail.sonic.net>
X-IsSubscribed: yes

David Christensen schrieb:
> pod-people & perlbug:
> I made the subject posting on the Cygwin mailing list.  Gerrit P. Haase
> confirmed the bug in pod2usage(), and requested that I forward the posting to
> pod-people and perlbug.  The referenced script attachments follow.

All three cases work fine for me on cygwin & perl 5.8.6 with default 
configuration.
Having the scripts on textmounts and on binmounts.

Just if the scripts are on textmounts and the files with CRLF, test0 and 
test1 will fail. PERLIO not set.

However:
   PERLIO=crlf ./test1
and
   PERLIO=crlf ./test0
works ok, with those textmount cases.

Debugging through Pod::Usage, reveils that reading from the tied 
FileHandle will keep \r\n. Looks ok.

Pod::Parser::parse_from_filehandle ...
   DB<1> x $in_fh
0  GLOB(0x8f2534)
    -> *Symbol::GEN0
          FileHandle({*Symbol::GEN0}) => fileno(6)
  DB<2> c Pod::Select::is_selected
Pod::Select::is_selected(/usr/lib/perl5/5.8/Pod/Select.pm:508):

$_ = "=head1 SYNOPSIS\cM\cJ\cM\cJ";
if (/^=((?:sub)*)(?:head(?:ing)?|sec(?:tion)?)(\d*)\s+(.*)\s*$/) {
    my ($level, $heading) = ($2, $3);
}

   DB<2> x $heading
0  "SYNOPSIS\cM"

Which should be "SYNOPSIS".

So my recommended fix would be this patch:

$ diff -bu Select.pm~ Select.pm
--- Select.pm~  2005-01-10 00:30:15.001000000 +0100
+++ Select.pm   2005-01-18 11:02:32.920797700 +0100
@@ -505,7 +505,7 @@

      ## Keep track of current sections levels and headings
      $_ = $paragraph;
-    if (/^=((?:sub)*)(?:head(?:ing)?|sec(?:tion)?)(\d*)\s+(.*)\s*$/) {
+    if (/^=((?:sub)*)(?:head(?:ing)?|sec(?:tion)?)(\d*)\s+(.*?)\s*$/) {
          ## This is a section heading command
          my ($level, $heading) = ($2, $3);
          $level = 1 + (length($1) / 3)  if ((! length $level) || 
(length $1));


> -----Original Message-----
> From: David Christensen [mailto: dpchrist at holgerdanske dot com] 
> Sent: Sunday, January 16, 2005 7:03 PM
> To: 'cygwin at cygwin dot com'
> Subject: Cygwin Perl bug -- pod2usage(-verbose => 0) & pod2usage(-verbose => 1)
> 
> Cygwin:
> 
> Perl Pod::Usage pod2usage(-verbose => 0) is supposed to display the Pod SYNOPSIS
> information (ref. 'perdoc Pod::Usage').  See attached script 'test0'.  On Debian
> 3.0r2, it works:
> 
>     <CVSENV>dpchrist AT p166d302:~/cygwin-issues/Pod-Usage$ perl test0
>     Usage:
>         This is the synopsis...
> 
> On Cygwin, it exits without displaying anything.
> 
> pod2usage(-verbose => 1) is supposed to display the Pod SYNOPSIS, OPTIONS,
> ARGUMENTS, and/or OPTIONS AND ARGUMENTS sections.  See attached script 'test1'.
> On Debian, it works:
> 
>     <CVSENV>dpchrist AT p166d302:~/cygwin-issues/Pod-Usage$ perl test1
>     Usage:
>         This is the synopsis...
> 
>     Options:
>         Here are the options...
> 
> On Cygwin, it exits without displaying anything.
> 
> 
> pod2usage(-verbose => 2) is supposed to display the entire Pod documentation.
> See attached script 'test2'.  It works on both Debian and Cygwin.
> 
> 
> Checking the mailing list archive, I see one report but no resolution:
> 
> 	http://sources.redhat.com/ml/cygwin/2002-01/msg01392.html
> 
> 
> Google didn't seem to have much on this either.
> 
> dpchrist AT p42800e:~/mydocuments/cygwin-issues/Pod-Usage$ cat test0
> #! /usr/bin/perl -w
> use Pod::Usage;
> 
> pod2usage(-verbose => 0);
> 
> =pod
> 
> =head1 NAME
> 
> test - demonstrates Cygwin bug in pod2usage.
> 
> =head1 SYNOPSIS
> 
> This is the synopsis...
> 
> =head1 OPTIONS
> 
> Here are the options...
> 
> =head1 DESCRIPTION
> 
> Descriptive text...
> 
> =cut
> dpchrist AT p42800e:~/mydocuments/cygwin-issues/Pod-Usage$ cat test1
> #! /usr/bin/perl -w
> use Pod::Usage;
> 
> pod2usage(-verbose => 1);
> 
> =pod
> 
> =head1 NAME
> 
> test - demonstrates Cygwin bug in pod2usage.
> 
> =head1 SYNOPSIS
> 
> This is the synopsis...
> 
> =head1 OPTIONS
> 
> Here are the options...
> 
> =head1 DESCRIPTION
> 
> Descriptive text...
> 
> =cut
> dpchrist AT p42800e:~/mydocuments/cygwin-issues/Pod-Usage$ cat test2
> #! /usr/bin/perl -w
> use Pod::Usage;
> 
> pod2usage(-verbose => 2);
> 
> =pod
> 
> =head1 NAME
> 
> test - demonstrates Cygwin bug in pod2usage.
> 
> =head1 SYNOPSIS
> 
> This is the synopsis...
> 
> =head1 OPTIONS
> 
> Here are the options...
> 
> =head1 DESCRIPTION
> 
> Descriptive text...
> 
> =cut
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019