Subject: | Segfaults when run in a fork with "use Mac::AppleScrpit" |
This works:
==========================
my $pid = fork;
if ($pid == 0 ) {
my @command = (
"tell application \"Safari\"",
"end tell"
);
require Mac::AppleScript;
my $result = Mac::AppleScript::RunAppleScript(join "\n", @command);
print 'got something';
exit;
}
waitpid $pid, 0
==========================
This, however, does not work and causes a segfault:
==========================
use Mac::AppleScript;
my $pid = fork;
if ($pid == 0 ) {
my @command = (
"tell application \"Safari\"",
"end tell"
);
my $result = Mac::AppleScript::RunAppleScript(join "\n", @command);
print 'I never get printed';
exit;
}
waitpid $pid, 0