Hi Alan,

I would try to have a perl or shell script invoked in your bundle that invoked 
the perl for you with:

        VERSIONER_PERL_PREFER_32_BIT=yes /usr/bin/perl ...

or somesuch.  Or better if you can set that environment in your bundle and have 
it propagated to your perl script.  It should do the same as yours, but without 
changing the user's preferences, which would probably be bad.

It would probably be possible to make a subset of Mac-Carbon run under 64 bits, 
but much of it would not work, and it's a lot of work for what may be little 

Here's a post I wrote about this some time back:


Good luck!

On Mar 6, 2011, at 06:38, Alan Fry wrote:

> I have made a small Applet containing a Perl script intended for use by folk 
> not necessarily conversant with Perl. The script is inside the applet bundle, 
> is called by AppleScript and works as intended.
> Unfortunately the Perl script itself calls 'MacPerl::DoAppleScript' which 
> causes an error if the version of Perl is 5.10.0, which is the case of course 
> on 'Snow Leopard' machines. The problem can be resolved by setting 
> 'Prefer-32-Bit' to 'Yes' in 'com.apple.versioner.perl.plist'. The question is 
> how to achieve this, bearing  in  mind some (possibly most) of the users will 
> be unused to Perl and terrified of using the Terminal.
> I have resolved this difficulty for the moment by placing another Perl script 
> in the applet bundle which reads simply
> if (qx(file /usr/bin/perl) =~ /executable x86_64/) {
>       qx(defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes)
> }
> The notion behind this is that if the default version of the perl executable 
> is compiled for Intel 64 bit architecture it probably is 64 bit perl (?) and 
> Prefer-32-Bit should therefore be set to 'Yes'. This script is run before the 
> main Perl script is launched by which time 'com.apple.versioner.perl.plist' 
> will have been updated.
> The first question is this. Is it acceptable to change the setting of 
> 'com.apple.versioner.perl.plist' on someone else's machine? What if the owner 
> wants to use 64 bit Perl? It is not sensible to restore the setting of 
> Prefer-32-Bit to 'No' at the end of the run because the owner may have 
> already set it to 'Yes' anyway.
> The second question is this. Is there a better way to resolve the problem of 
> how to contrive a portable Perl script incorporating a 
> 'MacPerl::DoAppleScript call?
> Suggestions would be most welcome.
> Alan Fry

Chris Nandor

Reply via email to