in reply to Re^2: Perl jumps to END logic after fileno (Win32)
in thread Perl jumps to END logic after fileno (Win32)
Hi,
What?
#!/usr/bin/perl -- use strict; use warnings; use autodie qw/ open close /; use threads stack_size => 4096; open FOO, '<', __FILE__ or die $!; if( @ARGV ){ #~ threads->create(sub { use autodie qw/ close /; close FOO; })->d +etach; threads->create(sub { close FOO; })->join; threads->create(sub { close FOO; ## close FOO; ## this one autodies, "terminated abnormally:" eval { close FOO; 1 } or warn $@; return; })->join; close FOO; close FOO; ## this one autodies } else { close FOO; close FOO; ## this one autodies } __END__ $ perl threads-close-filehandle.pl Can't close filehandle 'FOO': 'Bad file descriptor' at threads-close-f +ilehandle.pl line 22 $ perl threads-close-filehandle.pl 1 Can't close filehandle 'FOO': 'Bad file descriptor' at threads-close-f +ilehandle.pl line 15 Can't close filehandle 'FOO': 'Bad file descriptor' at threads-close-f +ilehandle.pl line 19
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl jumps to END logic after fileno (Win32)
by dchidelf (Novice) on Aug 10, 2017 at 18:41 UTC | |
by Anonymous Monk on Aug 10, 2017 at 23:33 UTC |