develooper Front page | perl.perl5.porters | Postings from October 2005

[perl #37533] open pragma ignored for all 3-arg opens

Thread Next
From:
Ken Hirsch
Date:
October 25, 2005 16:18
Subject:
[perl #37533] open pragma ignored for all 3-arg opens
Message ID:
rt-3.0.11-37533-123282.9.71627680853253@perl.org
# New Ticket Created by  Ken Hirsch 
# Please include the string:  [perl #37533]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37533 >


This is a bug report for perl from kenhirsch@ftml.net,
generated with the help of perlbug 1.35 running under perl v5.8.5.


-----------------------------------------------------------------
[Please enter your report here]

use open ':encoding(iso-8859-7)';
open OUT, ">test1.txt" or die "cannot open test1.txt: $!\n";
print OUT chr(0x3b1), "\n";
__END__
The above program works fine, printing a "\xe1" character to test1.txt

____
use open ':encoding(iso-8859-7)';
open OUT, ">", "test2.txt" or die "cannot open test2.txt: $!\n";
print OUT chr(0x3b1), "\n";
__END__
This program, however, prints "\xce\xb1" to file and warns
"Wide character in print at bug4.pl line 3."


The documentation for open in perlfunc says
  "(Note that if layers are specified in the three-arg form then default
  layers set by the C<open> pragma are ignored.)"

But, the default layers appear to be ignored for all three-arg opens.


The documentation for the open pragma says:
  "When open() is given an explicit list of layers they are appended to
  the list declared using this pragma."

which is even more wrong.
#
# Applies to perl versions 5.8.x to bleadperl 5.9.3 patch 25712 2005-10-25


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.5:

Configured by gerrit at Thu Aug 19 19:39:49     2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=cygwin, osvers=1.5.10(0.11642), 
archname=cygwin-thread-multi-64int
    uname='cygwin_nt-5.1 inspiron 1.5.10(0.11642) 2004-05-25 22:07 i686 
unknown unknown cygwin '
    config_args='-de -Dmksymlinks -Duse64bitint -Dusethreads 
-Doptimize=-O2 -Dman3ext=3pm'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing 
-pipe -I/usr/local/include',
    optimize='-O2',
    cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe 
-I/usr/local/include'
    ccversion='', gccversion='3.3.3 (cygwin special)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, 
Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ld2', ldflags =' -s -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib
    libs=-lgdbm -ldb -lcrypt -lgdbm_compat
    perllibs=-lcrypt -lgdbm_compat
    libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
    cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.5:
    /usr/lib/perl5/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/5.8.5
    /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl
    .

---
Environment for perl v5.8.5:
    CYGWIN=tty
    HOME=/home/Hirschk
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    
PATH=/bin:/home/Hirschk/bin:/perl/bin:/usr/local/bin:/usr/bin:/bin:/Perl/bin/:/usr/bin:/Python21/:/Program 
Files/Reflection:/emacs-20.7/bin:/vim/current:/Program 
Files/Reflection:/WINNT/system32:/WINNT:/WINNT/System32/Wbem:/WINNT/system32/nls:/WINNT/system32/nls/English:/Program 
Files/Novell/ZENworks/:/Program Files/thinktecture/WsContractFirst 
0.4/:/Program 
Files/Reflection/:/PROGRA~1/CHEZSC~1/csv6.9c/i3nt:/PROGRA~1/Tcl/bin:/Program 
Files/Microsoft Visual Studio/Common/Tools/WinNT:/Program 
Files/Microsoft Visual Studio/Common/MSDev98/Bin:/Program 
Files/Microsoft Visual Studio/Common/Tools:/Program Files/Microsoft 
Visual Studio/VC98/bin:/Program Files/MiKTeX/miktex/bin:/Program 
Files/Hugs98:Z:.:.
    PERL_BADLANG (unset)
    SHELL (unset)


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About