Subject: perl & textmode mounts
From: Jörg Schaible <[email-masked]>
To: <[email-masked]>
Date: Tue, 22 Jan 2002 23:41:55 +0100

Hi Perl porters,

there seems still an issue concerning textmode mounts and perl. I already found
http://www.cygwin.com/ml/cygwin/2001-08/msg00981.html and
http://www.cygwin.com/ml/cygwin/2001-03/msg01345.html
indicating, that this issue is not solved.

The error occurs in my case using Perl module functionality itself. Basically I want to use pod2usage (see perldoc Pod::Usage), but calling the function with verbose level 0 or 1 produces simply no output (bigger levels use a perldoc task). The POD sections won't be matched, because of a trailing \cM. My perl script itself is in a directory mounted in textmode.

I used the Perl debugger to locate the problems:

1) cygwin-multi/Pod/Parser.pm:1173
The file is opened with 
open( $in_fh, "< $infile");
This line seems to be the problem, since the file is opened binary, because ...

2) cygwin-multi/Pod/Parser.pm:1060
A textline is read using the expression "<$in_fh>". $textline value has an appended "\cM\cJ"

3) cygwin-multi/Pod/Select.pm:508
The regular expression will extract in $3 the header of the section with a trailing "\cM", so the selected sections will never match.

According to "perldoc -f binmode" I should be able to set textmode manually using
binmode( $in_fh, ":crlf" );
directly after the open command. I modified Parser.pm accordingly. Unfortunately this had no effect either. I assume the Perl build does not know about running in Windows, so it ignores binmode() totally as documented.

Only if I save my perl script in Unix format (on the textmode mount !!) it works as expected! Unfortunately *this* will scramble the checkin/checkout with CVS :(

Since the Perl sources are quite big - has anybody a clue where to start looking for this bug ?

Regards,
Jörg

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/