
Recently I have been asked to make some changes to a Windows application written in Perl. As a Mac user it raised the issue of how to write the code and have it end up as a .exe file for running on a Windows 2003 server.
Cross platform is probably possible, but why bother. I have a nice little Virtual Machine (VM) in Parallels with XP on it. So I decided to clone this XP machine and set it up for use exclusively as a development environment for this Perl code.
Previously I had used ActivePerl, the context text editor and perl2exe to develop Perl code and turn it into an EXE when I worked as an employee elsewhere. This time I decided to go a different path and try Strawberry Perl and Padre. This is really easy, "Alias" had done all the work for me ( http://use.perl.org/~Alias/journal/38312 ) I was also tempted by ( http://padre.perlide.org/wiki/PortableStrawberry ) which is the Strawberry Perl and Padre for portable use on a USB stick.
So I downloaded the .EXE ( which was not quick ) and away I went. It installed no problem at all, the only trick is that there is no icon for Padre installed. So you click START, RUN, then type in padre and hit return. Up it pop and looks a lot like... well like notepad.
I tried immediately to run the code, and it failed as I was missing a CPAN module. So from within Padre I clicked on Perl in the toolbar and then Install Module, Install CPAN Module. I simple typed in the name of the module foo::bar and off it went and downloaded and installed the module for me. I hit F5 to run the Perl code again and cool, it worked.
After running the code I wanted to make some changes (hypothetically at least), so I opened the subs window, which comes up like a sidebar on the right and it had all the subroutines in my code. Double clicking on them took me right to that subroutine in the main editing window. This was/is a must have feature and at first I didn't think it was there.
I found this through the view menu, which had quite a few other features disabled, like code folding, which I turned on then off as I don't really like it aesthetically speaking. :-) Turning on Syntax checking is good for catching silly errors.
Part of the project I have to do is to deliver the code as a Windows Executable (.exe) file. previously I have done this with Perl2Exe, but I wanted to try it using just Strawberry.
This requires bits and bobs that are not installed by default, so you need to install things manually, I shall post on that in another entry.


Search



