krypted.com

Tiny Deathstars of Foulness

There are a lot of versions of the popular perl scripting language out there, and depending on what version you may have written a script with you might find that using a different version than the one that comes with an OS by default can have a drastic impact on a script. In Mac OS X you can change the default version of perl that the perl and a2p command will use. Before doing so you should check the version of perl being used by default, which can be done using the perl command, followed by the -v option:
perl -v
By default, the OS currently uses version 5.10.0. To change the version, you would use the defaults command to change the com.apple.versioner.perl defaults domain. You will add a key called Version with a string of the version you would like to use. For example, to switch to 5.8.8:
defaults write com.apple.versioner.perl Version -string 5.8.8
To change it back to 5.10.0:
defaults write com.apple.versioner.perl Version -string 5.10.0
You can also set perl to run in 32 bit mode:
defaults write com.apple.versioner.perl Prefer-32-Bit -boolean TRUE
To put it back:
defaults write com.apple.versioner.perl Prefer-32-Bit -boolean FALSE
Python provides the same functionality:
defaults write com.apple.versioner.python Version -string 2.6
Or to run Python in 32-bit mode:
defaults write com.apple.versioner.python Prefer-32-Bit -boolean TRUE

June 8th, 2010

Posted In: Mac OS X

Tags: , , , , , ,

Did you know that System Preferences is a 64-bit application? Stands to reason, but one thing I realized recently while working on some code for a System Preference pane is that 32-bit System Preferences cause System Preferences to react differently. You can use 32-bit preference panes but using them prompts you to quit System Preferences, which relaunches into a 32-bit mode. Going back to 64-bit mode also requires a relaunch. This is a great reason for developers to get their code upgraded sooner rather than later as I can’t imagine this compatibility mode will last forever…

January 9th, 2010

Posted In: Mac OS X, Mac OS X Server, Mac Security, Uncategorized

Tags: , , , ,

Sometimes ya’ just need to run Perl in 32-bit. Regrettably. To do so:
defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes

December 10th, 2009

Posted In: Mac OS X

Tags: , ,