DearHeart has asked for the wisdom of the Perl Monks concerning the following question:

There is someone(s) wiser than me out there! I am developing on a Windows box (and do not have access to Linux) and upload to a Linux server. My hosting service does not allow command prompt access to the server and does not want to install additional Perl packages. I cannot use the cpan module because, as far as I can see, you need to run it from the command line to configure. I tried to use PPM in a perl cript, but they do not have PPM.pm installed! Finally, I followed these steps to use my packages up till now: 1) Made a sub-directory "lib" from the "cgi-bin" directory. 2) FTP'd the packages from my PC to the host server in their appropriate sub-directories. 3) Put the following statement at the top of my Perl files: use lib "/home/httpd/html/mydir/cgi-bin/lib;" The following packages work without a problem:
use Net::POP3; use MIME::QuotedPrint; use MIME::Parser; use DBI; use URI::Escape; use XML::Simple; use Data::Dumper;
But when I try to use MIME::Lite and MIME::Lite::HTML the following errors are returned:
Software error: [Fri Aug 2 17:18:53 2002] HTML.pm: [Fri Aug 2 17:18:53 2002] HTML.pm: +[Fri Aug 2 17:18:53 2002] LinkExtor.pm: [Fri Aug 2 17:18:53 2002] Par +ser.pm: [Fri Aug 2 17:18:53 2002] Entities.pm: Can't locate loadable +object for module HTML::Parser in @INC (@INC contains: /home/httpd/ht +ml/mydir/cgi-bin/lib /usr/lib/perl5/5.00502/i386-linux-thread /usr/li +b/perl5/5.00502 /usr/lib/perl5/site-perl/i386-linux-thread /usr/lib/p +erl5/site-perl .) at /home/httpd/html/mydir/cgi-bin/lib/HTML/LinkExto +r.pm line 26 [Fri Aug 2 17:18:53 2002] HTML.pm: [Fri Aug 2 17:18:53 2 +002] HTML.pm: BEGIN failed--compilation aborted at /home/httpd/html/m +ydir/cgi-bin/lib/MIME/Lite/HTML.pm line 64. BEGIN failed--compilation + aborted at /home/httpd/html/mydir/cgi-bin/Test.pl line 46.
After searching for perlmonk wisdom I have determinded that MIME::Lite and MIME::Lite::HTML are dependent on HTML::Parser which contains binaries. After some more reading I installed Cygwin and gcc with the purpose of cross-compiling for the Linux platform. Before I continue, am I on the right track? Is there any easier way of cross-compiling for Linux? Did anyone ever write an article on preparing binaries on Windows for upload to a Linux server? I wait in anticipation...

Replies are listed 'Best First'.
Re: Compiling packages on Windows for use on Linux
by Chady (Priest) on Aug 05, 2002 at 12:12 UTC

    Cygwin can be a one way to do it.. but I doubt you'll be able to compile packages that contain binaries...

    Linux, OTOH, is free as you know, you can get your hands on a version just as easily as you can get Cygwin. I advise you to do so, install it on your computer (you can have a dual boot with windows) and you can easily copy the structure of your directories on the server. Now all you need to do is compile, test, and upload.

    Just beware that some packages require some more binaries to be present; like GD and Image::Magick...

    I hope this helps just a little bit.


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
Re: Compiling packages on Windows for use on Linux
by Jaap (Curate) on Aug 05, 2002 at 11:30 UTC
    I am sorry not to help you on your real issue but... Do yourself a favour and get ssh/telnet support. It makes life a lot easier imho. If your current host does not support it (at extra charge) switch hosts. Comes in handy if you want to debug by running a perl script on the command line too.
Re: Compiling packages on Windows for use on Linux
by Courage (Parson) on Aug 05, 2002 at 13:59 UTC
    I can share my experience on cross-compiling of perl and it's modules, and my speach will rather prove it's not only unsupported, but rather quite impossible to do.

    First of all, cross-compiler gcc on cygwin for Linux is very non-trivial, but still possible thing to do. But at second, you must have special Config.pm for those cross-purposes, and some more similar files, to do cross-compiling, and in no circumstances mix local Config.pm with cross one.

    I sent about 10 patches to perl5-porters for 5.8.0-pre to do some initial steps of Cross-compiling when, while on Win32, you compile perl and it's modules for WinCE device.
    I introduced an optionally-generated module Cross.pm which allows one to prepare makefile by running perl -MCross=wince Makefile.PL and then invoking of right "make" will cross-build with correct options.

    While that approach could be developed further to cover your case, it is quite non-tested now, requires 5.8.0 anyway and is a way with a lot of tough places everywhere.

    Which version of perl do they have on Linux?

    As a last resort, I'll suggest you to write and run a simple shell or perl script that does similar to following:

    cd /to/the/path/where-you-dloaded-module perl Makefile.PL make make test make install
    Execute it somehow, and with some luck you'll succeed.

    Best wishes,
    Courage, the Cowardly Dog