[Brisbane-pm] Lost in OSX
stephen at sydney.pm.org
Tue Sep 18 03:16:50 PDT 2007
> Do any of you work in Mac OS X?
I work in Sydney, but I use OS X ;-).
> I've got some pretty basic questions, such as...
> 1 I thought I installed Perl 5.8.8 from ActiveState, but when I
> type perl -v in terminal it says...
> This is perl, v5.8.6 built for darwin-thread-multi-2level
> (with 3 registered patches, see perl -V for more detail)
> What gives?
This is the Apple-installed Perl. I'd recommend using it, unless you
have a specific inclination for building your own version of perl.
In my experience, building your own perl is generally a less
hassle-some choice than using ActiveState because at some
point you'll want to install newer modules than are available
via their ppm repositories. I prefer to use the default perl
and CPAN tools, which work just fine.
> 2 How do I install modules, in particular DateTime?
# start by running Applications => Utilities => Terminal
sudo perl -MCPAN -e shell
... for more info, check out the CPAN docs at:
> 3 I can't find the Perl Package Manager on my system. Nor can my
> launcher, or spotlight.
Sounds like ActiveState Perl either isn't installed, or isn't in your
Either way you'll have much more luck installing current versions of
modules via the standard CPAN shell.
> 4 I've got a workaround for this, but how do I tell Mac OS X to
> open a .pl file with Perl? At present I'm running it in terminal
> with a perl perrmoss.pl command.
There are a few options, depending on what you're after:
Easiest to explain if you start from a Terminal window.
1) Would assume your myfile.pl looks something like:
# ==> all the real stuff happens here
(the important part here is having an initial #! line)
2) make the file executable
chmod +x myfile.pl
3) create the file association, if you haven't already
# open a Finder window in the current directory
# right-click on myfile.pl
# choose "Open With", then "Other..." from the right-click context
# browse to Applications => Utilitites
# change the "Enable" selection from "Recommended Applications" to
# check the "Always Open With" checkbox
# double-click on "Terminal"
4) double-click on myfile.pl from Finder and it should now run
i) Download and install the very handy Platypus app, which can be used
to make a quick OS X app around your .pl script:
Hope that helps get you on the right track. For perl hints, you might
want to have a look (or try posting) on http://perlmonks.org/.
More information about the Brisbane-pm