# Perl compiler for mac?? Win?



## liquidstrife (Mar 16, 2002)

I wrote a nifty little text editor in Perl, but need some compilers or somethin for the mac or unix. Any ideas?


----------



## Krevinek (Mar 17, 2002)

Hmm... compiler... no.
Interpreter... yes.

You can easily go to the main Perl distrobution center and get a copy of Perl 5.6 for Win or MacOS 9. No need to grab it for OS X since it comes with it... If your script is properly written, just type 'perl (your script file)' at the terminal and it will run. Or, if you give it executable perms under OS X and you script is properly formatted a simple './(your script file)' will run the script in the terminal.


----------



## Captain Code (Mar 17, 2002)

PERL is an interpreted language, not compiled.

The location of the Perl interpretor is /usr/bin/perl
on MacOSX.


----------



## serving2masters (Mar 18, 2002)

In the perl docs, it claims you can compile a script to a binary, but I've never tried it.

At the terminal, do "man perlcompile" and it will give you about 10 pages on it. I only read the first page or so, but it looks kind of complicated. 

In my experience everything runs fast enough just using the interpreter though, so you're probably better off just using it.


----------



## samad_lotia (Mar 24, 2002)

I'm not sure if you can compile a script, but I'm sure that modperl for Apache caches a lot of repeatedly executed code (perhaps in machine language?) to make the script run faster.


----------



## nkuvu (Mar 24, 2002)

Yes, you can compile a script.  On the Win32 side of things, ActiveState makes (or someone else makes -- darn, I don't 'member right now  ) a perl2exe compiler.

This is very useful if you want to distribute your script/program to others -- they won't need a Perl interpreter, nor will they need to worry about installing modules if your script uses them.

The problem (at least on Win32) is that the compiler has to link in a whole slew of dll's, which can make a 1K script turn into a 1MB program.

I run into a lot of problems with modules -- I can install modules easily, but my scripts are often used by the people I work with, and they don't even have the same Perl interpreter.  At work I am using ActiveState perl.  Others may be using Rational's ccperl, which has very few modules as standard.  So what I end up doing is copying the code from the module (approprately cited, of course) and dropping that into my scripts.  The biggest script I wrote weighs in at about 30K.

All of this may be completely useless information, since liquidstrife might be asking about interpreters, not compilers.


----------

