Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Perl Programming

How Well Does Perl2exe Work for Large Applications? 51

bobm writes "One of the issues with not using the 'standard' MS tools (VC, VB, etc) is that you face the possiblity of having to load a lot of DLL's to support an application. I'm in this boat with a Perl app I would like to migrate to a couple of Windows 2000 servers. It's a simple app that runs well on our Unix boxes and if it wasn't for the overhead of having to install perl and all of the required modules, it would be a no brainer. However I just stumbled upon Perl2Exe at Indigostar. A small app worked great and I'm wondering if anyone else has used it and how large of an app have they released? Any other pointers and info on pertinent issues would be helpful too."
This discussion has been archived. No new comments can be posted.

How Well Does Perl2exe Work for Large Applications?

Comments Filter:
  • My advice: don't (Score:2, Redundant)

    by scrytch ( 9198 )
    perl2exe basically statically links your perl app with the perl executable. While this might produce a fairly portable solution, consider the consequence of what will happen when you need to make a change, especially if it's a localized one (e.g. "this dev machine needs the data from a different file"). You are now distributing an opaque chunk of data that you cannot work with. You are losing one of the primary advantages of using a "prototyping" language in the first place. Consider simply distributing perl with the application. It's not like it's terribly complex, it's just an installer exe you double-click, take the defaults, and reboot (or convince it to accept the changes to your PATH in some more convoluted way).

    Of course if you're simply trying to distribute a closed-source perl app, more power to you, just be aware that it's not really all that hard to get source code back from the perl executable.
    • by ceejayoz ( 567949 )
      Consider simply distributing perl with the application.

      Read what the guy said:

      It's a simple app that runs well on our Unix boxes and if it wasn't for the overhead of having to install perl and all of the required modules, it would be a no brainer.
  • g'wan, give it a try

  • Overhead? (Score:2, Funny)

    by MrResistor ( 120588 )
    I'm in this boat with a Perl app I would like to migrate to a couple of Windows 2000 servers. It's a simple app that runs well on our Unix boxes and if it wasn't for the overhead of having to install perl and all of the required modules, it would be a no brainer.

    If you're that worried about overhead, why the hell are you migrating to Windows 2000?

    • I'm in this boat with a Perl app I would like to migrate to a couple of Windows 2000 servers. It's a simple app that runs well on our Unix boxes and if it wasn't for the overhead of having to install perl and all of the required modules, it would be a no brainer.

      He's not migrating to Win2K. He already has Win2K. He wants to migrate the Perl app from UNIX to Win2K.

      • Yes, I realize that. I feel my question still stands, though.

        On another note: Offtopic?!?!?!?

        What is wrong with you moderators? Did you even bother to read the fscking article?

        Flamebait, sure, I actually expected a flamebait mod. Troll I could see, maybe. But Offtopic?!? Come on!!!

  • by Raskolnk ( 26414 ) on Tuesday September 17, 2002 @10:15AM (#4272919)
    I've used it to build a moderately sized installation application that was distributed to clients to install our huge application. I had mixed results.

    Main problem was licensing. Because it was an installation app, the Build/CM team was responsible to maintain it. IIRC, the license was tied to a given username and host. So, developers can't build the installer themselves, the CM team must do it on request, or setup a shared perl2exe user for everyone on a build server somewhere. Developers, if they want to fix it, must go and work on the shared server. Pain in the ass.

    The other issue was lack of Perl know-how. When the compiler complained, I'd have ten people at my desk while I tried to explain how to setup @INC corrrectly.

    Seems like a _very_ small shop produces it, and is a little kludgey. Overall though, if my team was just me or a few Perl savvy people, I would recommend it.

    As an aside, my reasons behind using perl2exe were:

    1) perlcc didn't seem to work at all, and I didn't have the time to muck with it. Has anyone gotten this to work for more than just small or test programs?

    2) (and most obnoxious, at least with 5.003(?)) Perl is a pain in the ass to deploy. Licensing issues didn't allow us to distribute ActiveState on NT, and Perl really wants to be compiled on the target machine for Solaris. Compiling a distribution on Solaris hard-codes the prefix-dir, so it expects the target machine to have the same dir structure--which is in violation of my requirements. I emailed the mailing list and got a reply from non other than Randall Schwarz, who basically said (heavily paraphrased), "Yeah, that sucks. Someone's going to fix it eventually." The only solution I could come up with in a short amount of time was to write a wrapper script that mucked with @INC and included paths from the environment before execing anything else.

    I love the language, but this is why I don't use it. You can't depend on everyone having installed Perl + all your needed PMs themselves, and its not worth trying to automate it for them. IMHO, its the downfall of the language.

    We wanted to have Perl installed with our large Java system to help in performing scripting type tasks, but it was way too big of a pain. Oh well...

  • It is ok for some small stuff, but at $449 for the enterprise edition it isnt that good. I am still looking for a open source solution.
  • My advice: Do (Score:4, Interesting)

    by Mr_Silver ( 213637 ) on Tuesday September 17, 2002 @10:27AM (#4272995)
    Argh! Sometimes its really obvious that people who write comments like this [slashdot.org] have never deployed programs, don't think about users or perversly like using a sledgehammer to break a nut.

    For the record, I recommend using Perl2exe and avoid installing the Perl runtimes!

    I've used Perl2exe for, admitidally smaller programs, and it works great. Check out the options, you can either compile into one large exe, or use one (yes, one) additional dll and reduce the size of the program considerably.

    So basically, you have the best of both worlds. If it's only ever going to be one application, do a full binary and deal with the size. If there could be one or more, then consider using the dll.

    Yes, there are 2 downsides, one is the size of the application - but compaired to the size and hassle of installing the whole Perl distribution for every machine, it's a no-brainer.

    The other being the ability to edit the code. Well if there are individuals out there who need to edit it, they'll have the perl runtimes and you can just give them the source. But giving normal users carte blanche to edit the code is asking for hundreds of support calls.

    If options are needed code them in rather than get them to edit the source.

  • "having to install perl and all of the required modules".

    I am not a sysadmin (and I'm not trying to troll here), but how hard is it to install Perl? At my company, my boss and I installed Perl in a few minutes (30 or so). Surely it can't take that long to install Perl and a few modules, especially if you install Activestate's Perl.

    -Vic
    • I wanted to distribute ActiveState with our application, but it's licensing doesn't cater well to it. When we were interested (maybe 2 years ago) ActiveState required a certain sized logo to be printed on the packaging and the CDs. Only a small part of the product was Perl, so no one with any sense would have an ActiveState logo the same size as our own logo on all the media.

      We want to have a clean install that automates much of the work, rather than a huge pre-install guide instructing users how to setup all the required apps.
    • Geez
      A couple of years ago I had a tiny 8 line or so text mangling perl script that I would carry around on a floppy with a copy of a perl.exe on it.
      Just the script and the perl.exe and it ran fine. It wasn't the active state one either IIRC.
      Isn't there a perl source out there that you could build and distribute, or do you need all the Active state bells and whistles?
    • The OP mentions "a couple of Windows 2000 systems" so I'd tend to agree. If we're talking 50 systems then installing ActiveState Perl and running PPM to get the modules set up on each one would take some time.

      Some more information would help us improve the quality of advice. For example, is this a web CGI app, where the overhead of Perl2exe's static linking will be large compared to ISAPI Perl? Is the app run often enough that this overhead would matter?
      • If it's just a couple of boxes, why not just give them a couple of headless/tailless (no monitor, no keyboard|rat|mouse) linux boxes? Maybe recycle some old p100's.

        Save time, money, and get something more stable to bood (pun intended)

  • My experience (Score:4, Interesting)

    by Boglin ( 517490 ) on Tuesday September 17, 2002 @10:33AM (#4273043) Journal
    A couple of years back, I was writing a small program for language translation and I needed it to run on my classmates' Windows machines. Due to the heavy text processing nature of the project, Perl seemed like the prime choice. However, I knew there wasn't a wicket's chance in a supernova that I was going to get the end users to install Perl.

    Thus, I tried Perl2exe. There were two parts that really impressed me. First, it included all of the packages that I was using, including Perl/TK (as I said, Windows users. The looked at my initial console version like it was in Hieroglyphics.) I was also impressed that the program and dictionary could still be compressed to fit on a floppy, which was a huge relief from having to Perl burn CDs for all of the users. In the end, I would say that, if you are porting a simple maintenance script or other non-time critical application to the Win2k servers, by all means go with Perl2exe. However, if this is a critical part of your new Buzzword Server System, then read a post from someone who knows better.

  • A while back I needed to automate a few things without wanting to start VB or VC programming on several Win2000 pro computers. I tried perl and searched all modules, but never found one that adds a user, changes password and profile dir etc. In the end I settled on learning vbscript and after many a trial n error it worked. Since I maintain several *nix hosts and know perl well, it would be great to have either a perl2exe that works plus modules that are useful, eg ones that have ADSI equivalents. It would be even better if they could produce a perl compiler.
  • It can be a godsend (Score:4, Interesting)

    by n9hmg ( 548792 ) <n9hmg@hCOUGARotmail.com minus cat> on Tuesday September 17, 2002 @10:49AM (#4273159) Homepage
    Depending on your application, it can be an enormous help. Building the apps fully static lets you work on your application in perl, edit, run, modify, debug, enhance, run, etc. on your development machine, then slap out a binary that can be run on any other windoze machine by simply getting that machine access to the executable. You're not messing with the registry, sticking DLLs all over the place, and taking up disk space with a development system when all you need is to run the program you wrote with your development system. Sure, the individual binary is enormous, for what it does, at least, at small amounts of code (as the app grows, the overhead shrinks into insignificance).
    I had to write and run an application on a bunch of windoze boxen for a client a couple of years ago. I was not permitted to install anything. I got it working in perl, used an eval copy(it wasn't a long-term application) of perl2exe, got the job done, and everybody was happy. Sounds like your app is similar.
    One caveat: the big static binaries tend to load kind of slow, but as you know, everything has tradeoffs.
  • I *adore* Perl2exe (Score:2, Informative)

    by clintp ( 5169 )
    First off I don't:
    • use Perl2exe to obfuscate and hide my source code. Generally, I'll give it out to whoever asks for it.
    • use Perl2exe to speed up my code. That doesn't work. And if I wanted fast, I'd write in C.
    I know Perl isn't *terribly* difficult to install. But it's a helluva lot simpler to drop an exe file and maybe a DLL or two onto someone's system than the (ever growing) Perl distribution and the required modules. Heaven forbid I need to update Perl too. The software I distribute matches the version of Perl I've distributed with it. Always, and without hassle.

    The disk-space argument against perl2exe isn't holding much water lately either. I can distribute a perl2exe'd Perl program for about 2-3MB. My Perl installation (Activestate, including Tk) is about 40MB. So my tradeoff point on disk space is about 12 programs before I start "wasting" disk space. With 5.8 and 5.10 I'm sure that break-even point will be even higher.

    In the long run it makes support and distribution so much easier to people who have *zero* interest in using Perl, just my applications.

    I've distributed large (several thousand line) scripts using a lot of modules with lots of prerequisites (think Tk!) without problems. The *only* problem I run into are modules that aren't use'd until runtime need to be included manually before "compilation" into the exe (Tk is especially bad about this). That just means I need to test everything before I distribute it to make sure I've picked up all of the component modules.

  • My opinion: Do it. (Score:2, Informative)

    by IggyBung ( 45107 )
    In an attempt to keep our software build process as uniform as possible, we keep most of our build tools under version control, including a perl script to do a basic product release. Obviously, putting ALL of perl under out VCS just so people could run the build script was abhorent. The answer was to use perl2exe (actually perlapp from the Active State PDK [activestate.com], but the behaviour is similar).

    The script is not small, it performs alot of grunt work (version labeling, coping to archives etc) and I have NEVER had any problem with it. The executables it produces are perhaps a little big as they include everything necessary to run the script, and of course, startup time sufferers, but in terms of convenience, it can't be beat!

    My two cents anyway.

    Ian
  • Perl2exe problems (Score:3, Informative)

    by Xunker ( 6905 ) on Tuesday September 17, 2002 @11:45AM (#4273777) Homepage Journal
    I've used P2E a few times and I'm actually pretty happy with it save a few issues:

    1. Don't run the executables off a CD-ROM drive. They will run slow as dirt unless they are loaded from some sort fo fast media, faster than CD.

    2. You may have to declare ("use" or "require") stuff you wouldn't have to normally. A good example is "Storable" that is used by some modules -- you may have to explicitly declare that in your code to get it to "compile" right. The program will actually tell you what you need, though (usually).
  • I've used it to put out a medium sized application. Worked fine with no glitches, but in hindsite, it would have been a hell of a lot easier to just throw a web front end on it. Is that an option for you? Obvious advantages include only having one place to update code.
  • I've used it to create a number of scheduled tasks and command line utilities without incident... HOWEVER, I did notice some inconsistancies with the per2exe version.

    For example, v5.01 "compiles" scripts using the Socket module, but 5.03 bombs out on an @INC error.

    5.03 will properly package up Net::FTP but 5.01 will not unless you also package Sockets.

    Very unpredictable.

    It's just a pain to have to keep different versions of perl2exe around and know when to use which depending on the code.
  • by Futurepower(R) ( 558542 ) on Tuesday September 17, 2002 @01:01PM (#4274652) Homepage

    I've used IndigoStar's Perl2Exe for one 600-line CGI program that runs under FreeBSD. It works fine. The program I wrote provides a specialized form with lots of error-checking. Several people have access to the web site, including the customer's employees and all the employees of the web hosting provider. I didn't want someone changing or taking the code, so I wanted to compile the program.

    De-Compile? I was told that it is difficult to decompile a Perl2Exe executable. I'm interested in hearing from anyone with experience with this.

    Hide Perl Code? The HOT Ice [hotperl.com] "compiler" offers to obfuscate Perl code. Price: $3,995. As you might guess, I have no experience with this. Note that it does NOT compile the code.

    You don't always want to give away your source code. How do you hide your Perl source code?

    Other Perl Compilers? I'm very interested in hearing about other ways of compiling Perl programs. Perl2Exe is expensive, and tied to only one user. I've tried PerlCC and, as another comment poster said, was not able to get it to work. Apparently Perl2Exe is a cleaned-up version of a free Perl compiler. Is that correct?

    Indy Singh is IndigoStar. Apparently the only person in the IndigoStar company is Indy Singh. He is friendly enough, but not always available for technical support. He sometimes hires help, I was told, but that person was not able to give tech support. I was told to wait two weeks until Indy Singh returned from vacation.

    Philosophical question: On Slashdot it is politically correct to think that Perl is wonderful. However, it seems to me that every language should have both a compiler and interpreter. (CInt [root.cern.ch] is a C/C++ interpreter.) Several years ago, Perl was a quick and dirty way of doing simple things. Now Perl is a big language with all of the problems of other big languages, but is lacking in some of the tools. (For example, check out Perl IDE [sourceforge.net]. But, it is Windows only.) Perl debugging is primitive, too, it seems to me. I'd be interested in seeing an article that gives an overview of Perl debugging methods.

    Wouldn't it have been better to put energy into a C interpreter, giving it the functions that are needed, rather than make a new language? Aren't some of the quick and dirty features of Perl now looking messy and dirty?
    • Hide Perl Code? The HOT Ice [hotperl.com] "compiler" offers to obfuscate Perl code. Price: $3,995. As you might guess, I have no experience with this. Note that it does NOT compile the code.

      You don't always want to give away your source code. How do you hide your Perl source code?


      As the RIAA have shown to us, copy protection mechanisms wrapped around inherintly open architectures (such as iso9660 or Perl) are usually quite easily broken.

      In fact, copy-protected CDs appear quicker on kazaa than standard CDs. A license saying "do not redistribute" is as effective as the most expensive copy protection mechanism.

      I have seen a few Perl programs with restrictive licences. Usually the most prominent thing about the licence and install instructions is the following:

      chown priveleged_user program.pl
      chmod 111 program.pl

    • by scrytch ( 9198 )
      Unix comes with a perl obfuscator.

      cat

    • One way this has been done successfully is to embed the perl source, encrypted, in a small C program which feeds it to a perl interpretter (statically linked against the binary) at run time.

      The C program can then check a licence key, decrypt the embedded blob of Perl in memory, and eval the perl code.

      The code to do this isn't that complex (see perlembed)

      For this to work on Windows, you may need to replace any XS based Perl librarys you ship with it with pure Perl.
      Any constants you use for socket based stuff, and sysread/syswrite you will need to find their Windows equivalents - I'm afraid I can't help you much there.

      This may be something like what perl2exe does, although they may use the Bytecode interface or the modern equivalent of undump.
    • offers to obfuscate Perl code

      Isn't that an identity transformation?

    • Wouldn't it have been better to put energy into a C interpreter, giving it the functions that are needed, rather than make a new language?

      Perl does a lot of things that would be hard to shoehorn into C, and handles a lot of things that C programmers have to handle for themselves. Perl is vastly more than an interpreted C.

      You can argue that Python or Icon or Rexx or a dozen other languages are better then Perl's nitches but you can't argue that C is better; the people who wrote Perl, the people who first used and promoted Perl, and most the people who use Perl all knew C and like it or at least understand its strengths.
  • Try PerlApp (Score:3, Interesting)

    by apsyrtes ( 557388 ) on Tuesday September 17, 2002 @06:38PM (#4277769)
    I use PerlApp from the Perl Dev Kit by Activestate. I'd highly recommend the whole suite, it's been well worth the money for me (make executables, make windows services, make ActiveX controls, generate .MSI install packages, a kickass debugger, and a couple other goodies)

    I also tried perl2exe, but found my money was better spent on the Activestate kit. With PerlApp I can bind data files and .DLLs in the .EXE to be extracted/used at runtime, not sure if that can be done with perl2exe (correct me if I'm wrong!)

    To whomever thinks I should just go ahead and install Perl/modules/script/associated files - you can come work for me for free, there are only slightly over 500 desktop stations to distribute my application to.

    --apsyrtes
  • If you're writing a large application I suggest you don't use a scripting language. Why don't you write it in C/C++? Works on any platform with a compiler... If you have a big app, at some point you'll notice that you need more power than Perl can provide. But for smaller tasks Perl is tha king!
    • If you're writing a large application I suggest you don't use a scripting language. Why don't you write it in C/C++? Works on any platform with a compiler... If you have a big app, at some point you'll notice that you need more power than Perl can provide.

      You go from a high level language (like Perl) to a low level language (like C/C++) when you need speed, or you need to run it places where all the dependencies of the high level language are a burden. OTOH, high level languages let you do things easily that may be a pain to program on lower level languages (like regexs), and take care of things that you have to manually handle on lower level languages (like memory). You can add on libraries to handle the later, but a GC library won't run on "any platform with a compiler". So long as the user is happy with any limitations of your high level language (speed, possibly interpretation), then changing would be a lengthy rewrite for little win.
  • Tcl has two high quality free wrapping programs that turn scripts into executables that will fit onto a floppy - freewrap and prowrap. They're sweet!
  • Tied PerlApp... (Score:2, Informative)

    by Schwuk ( 52764 )
    I've not used perl2exe, but have used PerlApp in the Perl Dev Kit [activestate.com] by ActiveState [activestate.com]. It has worked very well for my needs: the client I currently work for installs perl on every machine, but it is the original pre-activestate version bundled in the NT Resource Kit. I need to use a more modern version for something, but they wouldn't agree to upgrade. Hence PerlApp.

    Ideally, I would upgrade all the machines, and have a shared site library for additional modules, but if until then, or for sites where you can't rely on perl being everywhere, PerlApp and perl2exe do a good job...

C'est magnifique, mais ce n'est pas l'Informatique. -- Bosquet [on seeing the IBM 4341]

Working...