Perl auf einem MacBook mit Mac OSX installieren
Ich liebe Perl. Perl ist toll um kleine und komplexe Aufgaben schnell zu erledigen.
Unter Linux ist Perl kein Problem, weil es immer vorinstalliert ist und die großen Distributionen schon sehr viele Module mitbringen. Aber wie geht das auf dem MacBook oder unter MacOSX?
Ich habe viele komplizierte Porenbeiträge gelesen und schon die Hände über dem Kopf zusammengeschlagen. Dann habe ich einfach cpan im Terminal eingetippt und siehe da. Das reicht. Der Rest geht automatisch.
~/work $ cpan
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer ’no‘ below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /System/Library/Perl/5.18/App/Cpan.pm line 553, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use ’sudo‘ (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose ‚local::lib‘, ’sudo‘ or ‚manual‘)
[local::lib]
Autoconfigured everything but ‚urllist‘.
Now you need to choose your CPAN mirror sites. You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes]
Trying to fetch a mirror list from the Internet
Fetching with LWP:
http://www.perl.org/CPAN/MIRRORED.BY
Looking for CPAN mirrors near you (please be patient)
…………………….. done!
New urllist
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/
http://lib.ugent.be/CPAN/
http://mirrors-uk.go-parts.com/cpan/
Autoconfiguration complete.
Attempting to bootstrap local::lib…
Writing /Users/hagen/.cpan/CPAN/MyConfig.pm for bootstrap…
commit: wrote ‚/Users/hagen/.cpan/CPAN/MyConfig.pm‘
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/authors/01mailrc.txt.gz
Reading ‚/Users/hagen/.cpan/sources/authors/01mailrc.txt.gz‘
………………………………………………………………….DONE
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/modules/02packages.details.txt.gz
Reading ‚/Users/hagen/.cpan/sources/modules/02packages.details.txt.gz‘
Database was generated on Fri, 12 Dec 2014 18:17:02 GMT
…………..
New CPAN.pm version (v2.05) available.
[Currently running version is v2.00]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
……………………………………………………..DONE
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/modules/03modlist.data.gz
Reading ‚/Users/hagen/.cpan/sources/modules/03modlist.data.gz‘
DONE
Writing /Users/hagen/.cpan/Metadata
Running make for H/HA/HAARG/local-lib-2.000015.tar.gz
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/authors/id/H/HA/HAARG/local-lib-2.000015.tar.gz
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/authors/id/H/HA/HAARG/CHECKSUMS
Checksum for /Users/hagen/.cpan/sources/authors/id/H/HA/HAARG/local-lib-2.000015.tar.gz ok
CPAN.pm: Building H/HA/HAARG/local-lib-2.000015.tar.gz
Attempting to create directory /Users/hagen/perl5
Dispatching deprecated method ‚CPAN::Config::load‘ to CPAN::HandleConfig
Reading ‚/Users/hagen/.cpan/Metadata‘
Database was generated on Fri, 12 Dec 2014 18:17:02 GMT
Running install for module ‚ExtUtils::MakeMaker‘
Running make for B/BI/BINGOS/ExtUtils-MakeMaker-7.04.tar.gz
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.04.tar.gz
Fetching with LWP:
http://www.mirrorservice.org/sites/cpan.perl.org/CPAN/authors/id/B/BI/BINGOS/CHECKSUMS
Checksum for /Users/hagen/.cpan/sources/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.04.tar.gz ok
CPAN.pm: Building B/BI/BINGOS/ExtUtils-MakeMaker-7.04.tar.gz
Using included version of CPAN::Meta::Requirements (2.127) as it is newer than the installed version (2.122).
Using included version of ExtUtils::Manifest (1.65) as it is newer than the installed version (1.63).
Using included version of JSON::PP (2.27203) as it is newer than the installed version (2.27202).
Using included version of Parse::CPAN::Meta (1.4405) as it is newer than the installed version (1.4404).
Checking if your kit is complete…
Looks good
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json
xcode-select: note: no developer tools were found at ‚/Applications/Xcode.app‘, requesting install. Choose an option in the dialog to download the command line developer tools.
BINGOS/ExtUtils-MakeMaker-7.04.tar.gz
/usr/bin/make — NOT OK
‚YAML‘ not installed, will not store persistent state
Running make test
Can’t test without successful make
Running make install
Make had returned bad status, install seems impossible
Checking if your kit is complete…
Looks good
Warning: prerequisite ExtUtils::MakeMaker 7.00 not found. We have 6.66.
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
—- Unsatisfied dependencies detected during —-
—- HAARG/local-lib-2.000015.tar.gz —-
ExtUtils::MakeMaker [requires]
Running make test
Delayed until after prerequisites
Running make install
Delayed until after prerequisites
Das war’s. Danach einfach span eintippen und fertig.
~/work $ cpan
Terminal does not support AddHistory.
cpan shell — CPAN exploration and modules installation (v2.00)
Enter ‚h‘ for help.
cpan[1]>
whoah this blog is fantastic i love studying your articles.
Stay up the good work! You recognize, a lot of persons are hunting around for
this information, thanks. Bobby