<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rich Waters &#187; Perl</title>
	<atom:link href="http://www.rich-waters.com/blog/category/perl/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rich-waters.com/blog</link>
	<description>Ext, Javascript, Notes/Domino, Ext.nd, Ruby on Rails</description>
	<lastBuildDate>Mon, 25 Jan 2010 19:44:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling Perl Scripts</title>
		<link>http://www.rich-waters.com/blog/2007/03/compiling-perl-scripts.html</link>
		<comments>http://www.rich-waters.com/blog/2007/03/compiling-perl-scripts.html#comments</comments>
		<pubDate>Wed, 28 Mar 2007 04:00:59 +0000</pubDate>
		<dc:creator>Rich Waters</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.rich-waters.com/blog/2007/03/compiling-perl-scripts.html</guid>
		<description><![CDATA[I had the need to compile a perl script into a Windows executable and turned to the trusty PAR package.  There are quite a few applications and ways to go about this, but PAR has by far produced the best results in my experiences.  The setup is a Windows XP box running Active [...]]]></description>
			<content:encoded><![CDATA[<p>I had the need to compile a perl script into a Windows executable and turned to the trusty <a href="http://par.perl.org/wiki/Main_Page">PAR package</a>.  There are quite a few applications and ways to go about this, but PAR has by far produced the best results in my experiences.  The setup is a Windows XP box running <a href="http://www.activestate.com/Products/ActivePerl/">Active Perl</a> with the following modules installed<br />
<blockquote>
Parse::Binary<br />
Win32::Exe<br />
Module::ScanDeps<br />
PAR::Dist<br />
PAR</p></blockquote>
<p><br/><br />
All modules are available via PPM or better yet CPAN (though on windows this would require <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084">nmake</a>).  Once you have all the proper modules compiling the script is a snap.  Most information I&#8217;ve found out there is outdated and shows all the parameters for the command line version, I find it much easier to just use &#8216;tkpp&#8217; which is the GUI version (this requires the Tk perl library).</p>
<p><img src="http://www.rich-waters.com/images/tkpp.jpg" title="tkpp" border="0"></p>
<p>Tkpp brings up a simple window with a couple options to pick.  Select the perl script in question, then designate an exe filename for it to generate.  I would recommend selecting &#8216;execute + static&#8217; which will help it detect the libraries needed at run time and automatically include them.  You can add additional libraries manually, but it&#8217;s normally not necessary.  If you want to specifiy an icon file for the generated executable you can.  If the app is GUI only you can check the box to make sure a separate console window isn&#8217;t launched.  Then just click on build and wait a little bit.  Once complete you get a stand alone exe file that can be ported to other windows machines without the need to install perl or any specific modules.</p>
<p>A couple of things to note.  There is no real protection of the code, the generated exe will actually extract all the perl files into a temporary folder and run them through an interpreter.  The first time that the exe is run it will delay about 30 seconds or so as it extracts all the files.  Future runs will go much more quickly.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2007%2F03%2Fcompiling-perl-scripts.html&amp;title=Compiling%20Perl%20Scripts&amp;bodytext=I%20had%20the%20need%20to%20compile%20a%20perl%20script%20into%20a%20Windows%20executable%20and%20turned%20to%20the%20trusty%20PAR%20package.%20%20There%20are%20quite%20a%20few%20applications%20and%20ways%20to%20go%20about%20this%2C%20but%20PAR%20has%20by%20far%20produced%20the%20best%20results%20in%20my%20experiences.%20%20The%20setup%20is%20a%20Win" title="Digg"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2007%2F03%2Fcompiling-perl-scripts.html&amp;t=Compiling%20Perl%20Scripts" title="Facebook"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2007%2F03%2Fcompiling-perl-scripts.html&amp;title=Compiling%20Perl%20Scripts&amp;annotation=I%20had%20the%20need%20to%20compile%20a%20perl%20script%20into%20a%20Windows%20executable%20and%20turned%20to%20the%20trusty%20PAR%20package.%20%20There%20are%20quite%20a%20few%20applications%20and%20ways%20to%20go%20about%20this%2C%20but%20PAR%20has%20by%20far%20produced%20the%20best%20results%20in%20my%20experiences.%20%20The%20setup%20is%20a%20Win" title="Google Bookmarks"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2007%2F03%2Fcompiling-perl-scripts.html&amp;title=Compiling%20Perl%20Scripts&amp;selection=I%20had%20the%20need%20to%20compile%20a%20perl%20script%20into%20a%20Windows%20executable%20and%20turned%20to%20the%20trusty%20PAR%20package.%20%20There%20are%20quite%20a%20few%20applications%20and%20ways%20to%20go%20about%20this%2C%20but%20PAR%20has%20by%20far%20produced%20the%20best%20results%20in%20my%20experiences.%20%20The%20setup%20is%20a%20Win" title="Posterous"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/posterous.png" title="Posterous" alt="Posterous" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.rich-waters.com/blog/feed" title="RSS"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://twitter.com/home?status=Compiling%20Perl%20Scripts%20-%20http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2007%2F03%2Fcompiling-perl-scripts.html" title="Twitter"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rich-waters.com/blog/2007/03/compiling-perl-scripts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penny Arcade &amp; Perl</title>
		<link>http://www.rich-waters.com/blog/2005/10/penny-arcade-perl.html</link>
		<comments>http://www.rich-waters.com/blog/2005/10/penny-arcade-perl.html#comments</comments>
		<pubDate>Sat, 29 Oct 2005 18:36:00 +0000</pubDate>
		<dc:creator>Rich Waters</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.rich-waters.com/blog/?p=4</guid>
		<description><![CDATA[This is a perl script I came up with quite some time ago, and had meant to make it available for others to use. The idea was that for a while I was downloading all the penny arcade comics and saving them in a folder for later viewing pleasure. After a while it became very [...]]]></description>
			<content:encoded><![CDATA[<p>This is a perl script I came up with quite some time ago, and had meant to make it available for others to use. The idea was that for a while I was downloading all the penny arcade comics and saving them in a folder for later viewing pleasure. After a while it became very difficult to find a comic when I went back to search for it due to the filenames only containing dates, I started saving the files with the title of the comic so I could find them later. This all seemed like way too much work for me, especially since I wanted to go back and get comics from the past couple years that I had been reading.</p>
<p>I was using perl for several other applications and wanted to try out some spidering with <a href="http://lwp.linpro.no/lwp/">LWP (Lib WWW Perl)</a> so I came up with this script. The idea is to download an archive of all the penny-arcade comics, to get a listing of comics I parsed their calendar.php site passing the year in the URL, this site displays a calendar with links to all their comics throughout the year. Also located in this page is the comic title in the title attribute of the anchor tags. Excellent! We have the date of the comic and the title right off the bat. I quickly built functionality to generate the image URL&#8217;s from the dates and save the files with the date and title. This was great, the script would do all the work of downloading the files, finding the title, organizing and naming it for me. I quickly ran into a few problems as they never seemed to follow a strict file naming convention, Since I didn&#8217;t really want to spend a whole lot of time on this I manually wrote in some fixes for the files I knew were missing. Also as a last note I wrote in some extra command line parameters to control the functionality a bit along the way, run the script with -h or -? To get a listing. Also if you want to run the perl version of this script you will need the LWP libraries which should come with most versions of perl as well as Tie::File and Getopt::Long.</p>
<p>End result, a script that parses the penny-arcade site for a list of all comics and downloads them into folders by year naming the files by date and title. I&#8217;m sure that there are probably a few more exception comics that I missed, but all in all for my first spidering program I&#8217;m pretty happy with it. As I get more and more into OO Perl I&#8217;ve been considering re-writing this script, perhaps if there&#8217;s interest I&#8217;ll do so.</p>
<p><a href="http://www.rich-waters.com/blog/code/paArchive.pl">Perl Script</a><br />
<a href="http://www.rich-waters.com/blog/code/paArchive.exe">Compiled Script</a><br />
Special note, the compiled script was created by a fairly generic perl compiler, it takes a while to run the first time you use it as it actually extracts the perl file and modules and runs them through an interpreter</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2005%2F10%2Fpenny-arcade-perl.html&amp;title=Penny%20Arcade%20%26amp%3B%20Perl&amp;bodytext=This%20is%20a%20perl%20script%20I%20came%20up%20with%20quite%20some%20time%20ago%2C%20and%20had%20meant%20to%20make%20it%20available%20for%20others%20to%20use.%20The%20idea%20was%20that%20for%20a%20while%20I%20was%20downloading%20all%20the%20penny%20arcade%20comics%20and%20saving%20them%20in%20a%20folder%20for%20later%20viewing%20pleasure.%20After%20" title="Digg"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2005%2F10%2Fpenny-arcade-perl.html&amp;t=Penny%20Arcade%20%26amp%3B%20Perl" title="Facebook"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2005%2F10%2Fpenny-arcade-perl.html&amp;title=Penny%20Arcade%20%26amp%3B%20Perl&amp;annotation=This%20is%20a%20perl%20script%20I%20came%20up%20with%20quite%20some%20time%20ago%2C%20and%20had%20meant%20to%20make%20it%20available%20for%20others%20to%20use.%20The%20idea%20was%20that%20for%20a%20while%20I%20was%20downloading%20all%20the%20penny%20arcade%20comics%20and%20saving%20them%20in%20a%20folder%20for%20later%20viewing%20pleasure.%20After%20" title="Google Bookmarks"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://posterous.com/share?linkto=http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2005%2F10%2Fpenny-arcade-perl.html&amp;title=Penny%20Arcade%20%26amp%3B%20Perl&amp;selection=This%20is%20a%20perl%20script%20I%20came%20up%20with%20quite%20some%20time%20ago%2C%20and%20had%20meant%20to%20make%20it%20available%20for%20others%20to%20use.%20The%20idea%20was%20that%20for%20a%20while%20I%20was%20downloading%20all%20the%20penny%20arcade%20comics%20and%20saving%20them%20in%20a%20folder%20for%20later%20viewing%20pleasure.%20After%20" title="Posterous"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/posterous.png" title="Posterous" alt="Posterous" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.rich-waters.com/blog/feed" title="RSS"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://twitter.com/home?status=Penny%20Arcade%20%26amp%3B%20Perl%20-%20http%3A%2F%2Fwww.rich-waters.com%2Fblog%2F2005%2F10%2Fpenny-arcade-perl.html" title="Twitter"><img src="http://www.rich-waters.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rich-waters.com/blog/2005/10/penny-arcade-perl.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
