Why am I getting a segmentation fault when I use binmode with threads in Perl?
- by jAndy
Hi Folks,
this call
my $th = threads->create(\&print, "Hello thread World!\n");
$th->join();
works fine. But as soon as I add
binmode(STDOUT, ":encoding(ISO-8859-1)");
to my script file, I get an error like "segmentation fault", "access denied".
What is wrong to define an encoding type when trying to call a perl thread?
Example:
use strict; use warnings;
use threads;
binmode(STDOUT, ":encoding(ISO-8859-1)");
my $th = threads->create(\&print, "Hello thread World!\n");
$th->join();
sub print {
print @_;
}
This code does not work for me.
Kind Regards
--Andy