develooper Front page | perl.perl5.porters | Postings from September 2001

weird stuff with newlines

From:
Nikola Knezevic
Date:
September 25, 2001 12:31
Subject:
weird stuff with newlines
Message ID:
4614723983.20010925212613@tesla.rcub.bg.ac.yu
This is happening with the bleadperl. perl -V down below...
-----output
e:\perl_extra\workin_bleadperl>set PERLIO=perlio

e:\perl_extra\workin_bleadperl>.\perl -e "print ord(<STDIN>);"

13
e:\perl_extra\workin_bleadperl>set PERLIO=stdio

e:\perl_extra\workin_bleadperl>.\perl -e "print ord(<STDIN>);"

10
e:\perl_extra\workin_bleadperl>
-----output

Another thing worth mentioning.
After doing .\perl -V >out.txt, file out.txt had unix line-ending style.
As perl doesn't know what are valid newlines on different OS'es.
ActivePerl build 522 doesn't have these problems. It outputs to screen
with CRLF pair line-ending.

Above programs are terminating immediately, returning the ASCII value of
something that is sitting in the console input stream from before the
program was run.

First I thought it was 4NT's problem, but posting Philip's program
(equivalent of print ord(<STDIN>);) it seems that it is only failing on
my platform. Noone could replicate problem using different compilers.
But they tested it on w2k and NT. Could someone test it under Win9x?

Could it be possible to flush the buffer at the very begining, before
perl starts to interpret scripts?



------.\perl -V
Summary of my perl5 (revision 5 undef) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -Gf -W3 -Od -MD -Zi -DDEBUGGING -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-Od -MD -Zi -DDEBUGGING',
    cppflags='-DWIN32'
    ccversion='undef', gccversion='', gccosandvers='undef'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug -pdb:none  -libpath:"c:\perl\lib\CORE"  -machine:x86'
    libpth=d:\DevStudio\VC\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=undef
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl57.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -pdb:none  -libpath:"c:\perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
        DEVEL12178
  Built under MSWin32
  Compiled at Sep 25 2001 14:08:51
  %ENV:
    PERL5SHELL="4nt /x /c"
    PERLIO="perlio"
  @INC:
    E:/Perl_extra/workin_bleadperl/lib
    .



-- 
 .            `\!,        
 .            <. .>    
 [=======oOo==( ^ )==oOo========[ indy@hemo.net ]=======]      
 |---      _    -            --- [    member of    ]--- |        
 [========( )======_==============[ .counter attack. ]==]           
 .         ()     ( )
 .                ()




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