Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Installing Perl/Tk (and other stuff) on OSX
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cptkrf" data-source="post: 1425306" data-attributes="member: 134861"><p>I have used Perl and Perl/Tk for several years. It was one of the reasons that I swapped over to OSX from Linux. Unfortunately, the Apple engineers don't make it easy. Many times incremental updates to OSX will break it, and major upgrades to a new version of Cat always do. </p><p></p><p>So, here is an easy way to install an independent Perl on your system in the Home folder that will be out of the line of fire by the App Store. It won't change OSX in any way so you won't unhook the Apple Perl installation. </p><p></p><p>If you want to get rid of all of it, just dump ~/home/perl5 in the trash and take the source line out of .bash_profile. Your system will be back like it was before you started.</p><p></p><p></p><p></p><p>1. Install Xcode. If you want to hack, you don't need the entire suite and you can just install the Unix utilities. But, I have found that this usually gets wrecked on the next update of Xcode. So, I recommend that you get the whole thing.</p><p></p><p>The following commands are run in a terminal window.</p><p></p><p>2. Install perlbrew with the command… (you can visit the website with <a href="http://perlbrew.pl/" target="_blank">Perlbrew</a> . I know that doesn't look like a URL, but it is.)</p><p> curl -kL <a href="http://install.perlbrew.pl" target="_blank">http://install.perlbrew.pl</a> | bash</p><p> </p><p>3. After the above install, put the following into your ~/home/.bash_profile. You will probably have to create the file, since most installs of OSX don't have it.</p><p> source ~/perl5/perlbrew/etc/bashrc</p><p> </p><p> Exit the terminal window and start another so your login reads the new .bash_profile </p><p> </p><p>4. Load which ever perl you want, with… (5.14.2 is the latest stable as of this writing.)</p><p> perlbrew install perl-5.14.2</p><p></p><p>5. Tell your system about it with...</p><p> perlbrew switch perl-5.14.2</p><p> </p><p>Note that you can load as many different perl versions as you wish.</p><p></p><p>Log out of your current terminal, then open up another one, so your .bash_profile gets read. </p><p></p><p>Run…</p><p> perl -V</p><p> …and you should get something like this...</p><p> </p><p> …bunch of stuff... </p><p> </p><p> @INC:</p><p> /</p><p> /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/darwin-2level</p><p> /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2</p><p> /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2level</p><p> /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2</p><p></p><p></p><p></p><p> </p><p>You should be ready to go. </p><p></p><p>In your perl program bang line, replace #!/usr/bin/perl with #!/Users/home/perl5/perlbrew/perls/perl-5.14.2/bin/perl</p><p>This is the way to point your script to which ever perl you want to use. In this case, 5.14.2</p><p> </p><p>Now, just install Tk (or any other CPAN module) the usual way with perl Makefile.PL, make, make test and make install. The make install now doesn't have to be done with root authority.</p><p></p><p>This install was tested on Lion and should work on Leopard, Snow Leopard, and survive the upgrade to Mountain Lion.</p></blockquote><p></p>
[QUOTE="cptkrf, post: 1425306, member: 134861"] I have used Perl and Perl/Tk for several years. It was one of the reasons that I swapped over to OSX from Linux. Unfortunately, the Apple engineers don't make it easy. Many times incremental updates to OSX will break it, and major upgrades to a new version of Cat always do. So, here is an easy way to install an independent Perl on your system in the Home folder that will be out of the line of fire by the App Store. It won't change OSX in any way so you won't unhook the Apple Perl installation. If you want to get rid of all of it, just dump ~/home/perl5 in the trash and take the source line out of .bash_profile. Your system will be back like it was before you started. 1. Install Xcode. If you want to hack, you don't need the entire suite and you can just install the Unix utilities. But, I have found that this usually gets wrecked on the next update of Xcode. So, I recommend that you get the whole thing. The following commands are run in a terminal window. 2. Install perlbrew with the command… (you can visit the website with [url=http://perlbrew.pl/]Perlbrew[/url] . I know that doesn't look like a URL, but it is.) curl -kL [url]http://install.perlbrew.pl[/url] | bash 3. After the above install, put the following into your ~/home/.bash_profile. You will probably have to create the file, since most installs of OSX don't have it. source ~/perl5/perlbrew/etc/bashrc Exit the terminal window and start another so your login reads the new .bash_profile 4. Load which ever perl you want, with… (5.14.2 is the latest stable as of this writing.) perlbrew install perl-5.14.2 5. Tell your system about it with... perlbrew switch perl-5.14.2 Note that you can load as many different perl versions as you wish. Log out of your current terminal, then open up another one, so your .bash_profile gets read. Run… perl -V …and you should get something like this... …bunch of stuff... @INC: / /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/darwin-2level /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2level /Users/home/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2 You should be ready to go. In your perl program bang line, replace #!/usr/bin/perl with #!/Users/home/perl5/perlbrew/perls/perl-5.14.2/bin/perl This is the way to point your script to which ever perl you want to use. In this case, 5.14.2 Now, just install Tk (or any other CPAN module) the usual way with perl Makefile.PL, make, make test and make install. The make install now doesn't have to be done with root authority. This install was tested on Lion and should work on Leopard, Snow Leopard, and survive the upgrade to Mountain Lion. [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Installing Perl/Tk (and other stuff) on OSX
Top