go ahead... be a heretic | |
PerlMonks |
using PAR to create a Perl environment on another PCby spurperl (Priest) |
on Sep 22, 2005 at 17:48 UTC ( [id://494222]=CUFP: print w/replies, xml ) | Need Help?? |
One of Perl's greatest strengths is CPAN - the staggering collection of modules that help solving a very wide range of tasks.
This strength has a catch, though - some of these modules are very, very difficult to install, especially on Windows machines. One of such modules is Win32::SerialPort and its brethen, which I use at work to amaze my colleagues in showing off that "this Perl thing" can even speak to our hardware via RS232. Win32::SerialPort is a torture to install, however, requiring a C compiler (not always present in EE development computers) and a lot of tweaking. I managed to install it on my PC some time ago and I don't want to repeat this experience. But, a need arouse to run custom Perl scripts with SerialPort on another computer. I like working with Perl code instead of a GUI. Send "abs", no probs - uncomment a little code that does it and run, this allows great flexibility. So, to "port" this method to a colleague's PC I used an original approach with PAR: First, I created a simple "host" script that "use"s SerialPort and other modules I need. This script allows to write a Perl file (using a simple GUI) and then "eval"s it, so that file can use these modules. Then, I wrapped the script in a simple GUI and packed it to an .exe with PAR. Voila ! I can now run my small Perl scripts with Win32::SerialPort even on the laboratory laptop that has no network connection.
Back to
Cool Uses for Perl
|
|