Short version: you can't.
Slightly longer version: even if you could it doesn't prevent a keen competent person reverse engineering your intellectual property.
Longer version: although much of Perl could be compiled into a machine language form, parts of Perl require the interpreter to be available at run time (string eval for example). There are various packing tools such as PAR that pack up your source code along with the Perl interpreter and any required modules into a stand alone application, at the cost of a fairly large "code" overhead and the runtime overhead of unpacking everything before your code can run.
This question comes up fairly frequently starting quite a long time ago (see Compiling Perl for example) and the answer hasn't changed a lot over the years.
Premature optimization is the root of all job security
|