perlquestion
wolf391
could someone shed some light why this program CRASHES the perl interpreter
(win7, perl 5.12.4 32bit)
<code>
#!/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;
</code>
while THIS works just fine:
<code>
#!/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;
</code>
really can't wrap my head around why the first example crashes.