wolf391 has asked for the wisdom of the Perl Monks concerning the following question:
could someone shed some light why this program CRASHES the perl interpreter
(win7, perl 5.12.4 32bit)
while THIS works just fine:#!/usr/bin/perl use strict; use warnings; use feature qw(say switch); use utf8; binmode( STDOUT, ':encoding(cp1252)'); my $pid = fork; die "Failed to fork: $! \n" unless defined $pid; if ($pid) { say 'äbökü€'; wait; exit 0; } say 'äbökü€'; exit 0;
really can't wrap my head around why the first example crashes.#!/usr/bin/perl use strict; use warnings; use feature qw(say switch); use utf8; my $pid = fork; die "Failed to fork: $! \n" unless defined $pid; if ($pid) { binmode( STDOUT, ':encoding(cp1252)'); say 'äbökü€'; wait; exit 0; } binmode( STDOUT, ':encoding(cp1252)'); say 'äbökü€'; exit 0;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: changing STDOUT encoding and fork CRASH
by bulk88 (Priest) on Jan 23, 2013 at 03:48 UTC | |
Re: changing STDOUT encoding and fork CRASH (bug is bug)
by Anonymous Monk on Jan 23, 2013 at 04:12 UTC | |
by Anonymous Monk on Jan 23, 2013 at 04:29 UTC | |
by wolf391 (Initiate) on Jan 23, 2013 at 10:44 UTC |
Back to
Seekers of Perl Wisdom