How can I deploy a Perl/Python/Ruby script without installing an interpreter?
Solution 1
You can use Perl Archive Toolkit to bring a minimal perl core + needed modules + your Perl program with you.
And you can even convert it using PAR Packer to a windows exe file that will run just like any other program, from an end user's perspective.
Solution 2
You can get Windows executables in all three languages.
- As usual with Perl, there's more than one way to do it:
- PAR Packer (free/open-source)
- perl2exe (shareware)
- PerlApp (part of the Perl Dev Kit from ActiveState, commercial)
- Python
- Ruby
Solution 3
Using PAR, the Perl Aachiver has already been mentioned in other answers, and is an excellent solution. There's a short tutorial on building executables using PAR that was published as a Perl Tip last year.
In most cases, if you have PAR::Packer already installed on your build system, you can create a stand-alone executable with no external dependencies or requirements with:
pp -o example.exe example.pl
In most cases PAR will do all the hard work of determining your module dependencies for you, but if it gets anything wrong there are additional command line options you can use to ensure they get included. See the pp documentation for more details.
All the best,
Paul
Solution 4
Are you sure there is a headache? ActivePerl and Strawberry Perl are dead easy to install on Windows with just a couple of mouse clicks. Python is just as easy to install from what I hear.
Have you tried installing any of those to see how easy it is? If those are hard for your customer, I don't see how giving them a script to run is going to be easier.
Or, maybe you can use something like a Docker image for Perl or provide it as a web service instead of an application.
Solution 5
You could convert the script to an executable. In Python and Windows you can easily do that with py2exe. There are similar solutions for Perl and Ruby, but I believe py2exe is both free and reliable.
Related videos on Youtube
frankish
Worked most of my career in Linux/UNIX environments with Perl, Java, Sybase. Worked as a Developer, QA Engineer and UNIX Systems Admininstrator I like to ask the good questions so all can benefit from the answers. Hard to beat the fastest guns in the west around here. ;-)
Updated on September 09, 2020Comments
-
frankish over 3 years
I want to write a piece of software which is essentially a regex data scrubber. I am going to take a contact list in CSV and remove all non-word characters and such from the person's name.
This project has Perl written all over it but my client base is largely non-technical and installing Perl on Windows would not be worth it for them.
Any ideas on how I can use a Perl/Python/Ruby type language without all the headaches of getting the interpreter on their computer?
Thought about web for a second but it would not work for business reasons.
-
Admin over 15 yearsThe thing about that is wxPython + py2exe = 25+ meg program.
-
frankish over 15 yearsOK, headache was a strong word.
-
frankish over 15 yearsIts not that its that complex but the idea for the script is so simple that if it is difficult in any way it may provide enough resistance that it is not worth it for them.
-
jrockway over 15 yearsWith 1TB disks costing $50 these days, who cares?
-
user1066101 over 15 yearsValue speaks for itself. If the script isn't valuable enough, find something cooler and more irresistible.
-
Jacob over 15 yearsThese aren't actually compilers, they just pack the Perl code into a specially designed programs. I don't know about the other examples.
-
JeffV over 15 yearsSure, it's easy but, sometimes you just do not want to install stuff (like an interpreter) on the clients machine. A self contained app on a thumb drive can be a handy tool.
-
Tomato over 15 yearsI dunno, if you think about 'compile' as an English word rather than a computing word, it's accurrate: these packagers collect up the necessary parts and bundle them together. Just as the creator of a compilation album collects singles into a bundle.
-
Adam Bellaire over 15 years@slim: That's true, but it could be interpreted either way. Using a different word is less ambiguous.
-
Tomato over 15 years@Adam that's also true. But the different word isn't right either. It's not being converted. I suppose since 'compile' is taken you could use the word 'collect'. That's a word linkers use... but then it's stronly analogous to linking.
-
Adam Bellaire over 15 years@slim: I think I'll just use a less specific word. :)
-
romandas almost 14 yearsYou also have to consider that installing Perl on the client machine means yet another thing the local sysadmin has to maintain in addition to the script, whereas with the packed script, they just maintain that. Assuming there is a sysadmin..
-
Moberg over 10 yearsSometimes you don't have the privileges to install programs on a computer.
-
PhilHibbs over 10 yearsClearly you haven't worked for a client with a paranoid IT security department. If you have to "install" it, it has to go through months of security auditing (and you have to submit a business case to justify the effort first). A single .exe file that needs no installation is much easier, you just say "we compiled it ourselves" and that makes the problem magically go away (they never ask where the compiler came from).
-
smith about 9 yearsstrawberry Perl have also a portable edtion where the user need only to copy it to his system