http://www.perlmonks.org?node_id=980778


in reply to How to run a linux/perl-based website on a CD for Windows

You could create a minimal live-cd of your favorite linux distro with your app pre-installed and configured, and install a browser with a bookmark to http://localhost/.

Take a look at PAR::Packer for some basic source protection.

Replies are listed 'Best First'.
Re^2: How to run a linux/perl-based website on a CD for Windows
by marto (Cardinal) on Jul 10, 2012 at 08:32 UTC

    "Take a look at PAR::Packer for some basic source protection."

    It's better not to think of what PAR offers as any sort of solution regarding source code protection. PAR::FAQ explains more.

Re^2: How to run a linux/perl-based website on a CD for Windows
by Polyglot (Chaplain) on Jul 10, 2012 at 00:46 UTC
    I have looked at PAR::Packer, and even managed to compile my script with it, which runs fine from the command prompt, but I have been unable to see how this would still be usable via a browser. Thoughts?

    The browser tried to show the binary code! (And of course, the HTML output does little good at the command prompt.)

    Blessings,

    ~Polyglot~

      Whoa, there, Polyglot; you do understand how HTML works and that CGI executables have to be executed by the server?

      If your attempt merely pointed the browser at the compiled script, it's not going to work as you appear to expect.

        To be honest, I've never programmed a CGI script in anything but Perl. I've always known, however, even from the beginning, that there were other ways to do it. I guess some use C or python, or ASP, or whatever. I have no experience with any of the alternatives, and have no idea whether any of them functions from a compiled state or not. So, yes, I suppose I am ignorant in this area. Programming is my hobby, not my bread and butter. This is why I appreciate perlmonks so much. It is wonderful to be able to share with other programmers.

        I know that the Perl script is compilable, but it still must be interactive, and needs to be able to access the MySQL database. I don't see how mysql would integrate with a compiled Perl program based on user inputs, nor how I can convert the web form into something that would be independent from a browser.

        Another puzzle, for me, since I've never done this before, is whether or not the compiled program would accept the "GET" or "POST" style tokens as command line arguments, or how I would pass the variables into it. Perhaps it's best that I just stick with Server2Go. I don't know any other way, and maybe there isn't really any other option. What do people do with compiled Perl/CGI programs anyway?

        Blessings,

        ~Polyglot~

      Polyglot,

        The browser tried to show the binary code!

      You already have some good answers, but to give you a little idea of what is going on when the browser gives the binary instead of the results of the binary. Most browsers are clients and expect to 'talk' to a server. This is really important when using cgi. What you need to do is install a small server on the CD that will execute your 'cgi-bin' scripts. I have never used it, but I believe CPAN has a Perl server that you might be able to include.

      Now if you really are going to charge for this CD, then my next comments are academic.

      You are already hosting the application, so the only reason the person from another country would want the CD is to get to your Perl scripts. So my question to the 'tracker' is "Why don't you put a link on your site to my site?" If that isn't acceptable, then just ignore the request.

      In the past, I used to offer 'free demos' that could be downloaded by anyone. But when you find your demo being sold on eBay for $5.00 as a real system, you quickly change the policy. Your name will be on it, so many will expect you to support it.

      Just a heads up!

      Good Luck!

      "Well done is better than well said." - Benjamin Franklin