This is the mail archive of the
mailing list for the Cygwin project.
perl & textmode mounts
- From: Jörg Schaible <joerg dot schaible at gmx dot de>
- To: <cygwin at cygwin dot com>
- Date: Tue, 22 Jan 2002 23:41:55 +0100
- Subject: perl & textmode mounts
- Organization: JSI
Hi Perl porters,
there seems still an issue concerning textmode mounts and perl. I already found
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:
The file is opened with
open( $in_fh, "< $infile");
This line seems to be the problem, since the file is opened binary, because ...
A textline is read using the expression "<$in_fh>". $textline value has an appended "\cM\cJ"
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 ?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html