Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closing STDERR confuses perl's warn & die #804

Closed
p5pRT opened this issue Nov 2, 1999 · 2 comments
Closed

closing STDERR confuses perl's warn & die #804

p5pRT opened this issue Nov 2, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 2, 1999

Migrated from rt.perl.org#1731 (status was 'resolved')

Searchable as RT1731$

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 1999

From Raphael_Manfredi@pobox.com


The following script​:

  1 open(STDERR, '>std.err');
  2 warn "test #1";
  3 close STDERR;
  4 open(STDERR, '>std2.err');
  5 warn "test #2";
  6 die "fatal";
  7 close STDERR;

when ran produces two files​:

  -rw-r--r-- 1 ram users 23 Nov 2 23​:30 std.err
  -rw-r--r-- 1 ram users 0 Nov 2 23​:30 std2.err

The first contains

  1 test #1 at bug line 2.

as expected. The second one is empty!

I'm running Debian 2.1 with some 2.2 packages unfortunately.
My kernel is Linux 2.0.38.

Raphael



Site configuration information for perl 5.00503​:

Configured by ram at Tue Nov 2 23​:12​:33 MET 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  Platform​:
  osname=linux, osvers=2.0.38, archname=i586-linux
  uname='linux lyon 2.0.38 #1 sun oct 3 15​:59​:30 mest 1999 i586 unknown '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='cc', optimize='-O2', gccversion=2.7.2.3
  cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
  ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
  stdchar='char', d_stdstdio=undef, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
  libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
  cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:
 


@​INC for perl 5.00503​:
  /home/ram/home/src/perl/lib
  /home/ram/home/src/perl/lib
  /home/ram/home/src/perl/lib
  /home/ram/home/src/perl/lib
  /usr/local/lib/perl5/5.00503/i586-linux
  /usr/local/lib/perl5/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i586-linux
  /usr/local/lib/perl5/site_perl/5.005
  .


Environment for perl 5.00503​:
  HOME=/home/ram
  LANG=fr_FR
  LANGUAGE (unset)
  LC_MESSAGES=C
  LC_MONETARY=C
  LC_NUMERIC=C
  LC_TIME=C
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/local/BerkeleyDB/bin​:/usr/local/bin​:/home/ram/bin/scripts/rdb​:/bin​:/usr/bin​:/sbin​:/usr/sbin​:/usr/contrib/bin​:/usr/bin/mh​:/etc​:/usr/bin/X11​:/usr/games​:/home/ram​:/home/ram/bin/scripts​:/home/ram/bin/home​:/home/ram/bin/x386​:/home/ram/bin/scripts/mh​:.​:/home/ram/bin/acri
  PERLLIB=​:/home/ram/home/src/perl/lib​:/home/ram/home/src/perl/lib​:/home/ram/home/src/perl/lib​:/home/ram/home/src/perl/lib
  PERL_BADLANG (unset)
  SHELL=/usr/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 1999

From @gsar

On Tue, 02 Nov 1999 23​:41​:27 +0100, Raphael Manfredi wrote​:

1  open\(STDERR\, '>std\.err'\);
2  warn "test \#1";
3  close STDERR;
4  open\(STDERR\, '>std2\.err'\);
5  warn "test \#2";
6  die "fatal";
7  close STDERR;

when ran produces two files​:

-rw-r--r-- 1 ram users 23 Nov 2 23​:30 std.err
-rw-r--r-- 1 ram users 0 Nov 2 23​:30 std2.err

The first contains

1  test \#1 at bug line 2\.

as expected. The second one is empty!

FYI, not so in 5.005_62.

Sarathy
gsar@​ActiveState.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant