develooper Front page | perl.macosx | Postings from August 2003

Re: Crash reading $|

Thread Previous | Thread Next
From:
Mark Alldritt
Date:
August 21, 2003 09:11
Subject:
Re: Crash reading $|
Message ID:
BB694B9D.1366D%alldritt@latenightsw.com
> local *STDOUT;  is causing a bus error if run in the terminal, so I
> guess your crash is happening before the line you indicate.
> 
> Nothing will be returned from this script if you uncomment your local
> declaration.  Without it, things go as expected.  Make of that what
> you will
> 
> 
> #!/usr/bin/perl
> #local *STDOUT;
> print "OK\n";
> $| == 0 and print '$| == 0' . $/  or print $/ ;
> !defined $| and print "undefined"

I'm not sure this is correct.  The local *STDOUT; statement stops output
appearing on stdout, and then there are the unflushed buffers at the time of
the crash.

Here's how I isolated the problem to the attempt to read $|

local *STDOUT; 

open(FH, ">> /Users/mall/Desktop/crash.log");
print FH "before\n";
close(FH); 

our $copy = $|; 

open(FH, ">> /Users/mall/Desktop/crash.log");
print FH "after\n";
close(FH); 

On my system, I see 'before' in my log, but not 'after'.

Cheers
-Mark

---------------------------------------------------------------------
Mark Alldritt                         Late Night Software Ltd.
Phone: 250-380-1725                   333 Moss Street
FAX:   250-383-3204                   Victoria, B.C.
WEB:   http://www.latenightsw.com/    CANADA  V8V-4M9
AIM:   markalldritt


Thread Previous | 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