Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade Perl on Mac OS X Mavericks

The newly release Mavericks has removed the deprecated module "Switch.pm" from its repository. However, I have recently try to build AOSP source tree and it somehow uses this module to generate "make-hash-tools.pl"

The Mavericks has perl version of 5.16.2, and its predecessor Mountain Lion has a 5.12.4. Is there a way to downgrade my Perl?

Compilation error looks like this:

  Can't locate Switch.pm in @INC (@INC contains: /Library/Perl/5.16/darwin-thread-\ 
  multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level\
  /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2\
  /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16\
  /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level \
  /System/Library/Perl/Extras/5.16 .) at external/webkit/Source/WebCore\
  /make-hash-tools.pl line 23.

Thanks~!

like image 940
tutormike Avatar asked Jan 25 '26 01:01

tutormike


1 Answers

You can use perlbrew to install a parallel version of Perl in its own directory with its own modules. Currently it lets you install Perl as far back as 5.003_07, although not all of them are supported by Perl Porters for security fixes.

It would probably be simpler to install Switch from CPAN though.

like image 62
Quentin Avatar answered Jan 27 '26 18:01

Quentin