<?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>What Dave writes &#187; Perl</title>
	<atom:link href="http://davetang.org/wordpress/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://davetang.org/wordpress</link>
	<description>Movies, books, computers, etc.</description>
	<lastBuildDate>Thu, 01 Jul 2010 13:46:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>OOP</title>
		<link>http://davetang.org/wordpress/2009/12/05/oop/</link>
		<comments>http://davetang.org/wordpress/2009/12/05/oop/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:45:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[exercise]]></category>

		<guid isPermaLink="false">http://davetang.org/wordpress/?p=59</guid>
		<description><![CDATA[Object orientated Perl! Boy, if there is one thing that I want to fully grasp, this would be it. So I spent time (yet again) reading perldoc perlboot. This would be the second time I&#8217;ve been through the beginner&#8217;s guide to OO Perl. Here&#8217;s are the key points (from memory which may be inaccurate): Packages [...]]]></description>
			<content:encoded><![CDATA[<p>Object orientated Perl! Boy, if there is one thing that I want to fully grasp, this would be it. So I spent time (yet again) reading perldoc perlboot. This would be the second time I&#8217;ve been through the beginner&#8217;s guide to OO Perl. Here&#8217;s are the key points (from memory which may be inaccurate):</p>
<ol>
<li>Packages are used to create &#8220;Classes&#8221;</li>
<li>In each class, you have methods which operate on an object</li>
<li>Methods are created by using Perl&#8217;s subroutines</li>
<li>Methods from can be &#8220;inherited&#8221; from another class using the @ISA array</li>
<li>The @ISA variable needs to be explicitly (if that&#8217;s the right word) declared, either using the full namespace or defined globally using &#8220;our&#8221;</li>
<li>A constructor is a method used to create a specific instance</li>
<li>An instance is a blessed Perl reference (be it a scalar, hash or array)</li>
<li>The arrow invocation arrow &#8220;->&#8221; is used to specify a method for an object (i.e. $object->$method)</li>
<li>When using &#8220;->&#8221; with an instance, the first argument passed to the method is the object</li>
<li>When using &#8220;->&#8221; in the manner of Class->method, the first argument passed will be the class</li>
<li>Interestingly (to me), when you use &#8220;->&#8221; with an instance, the method can still pick up the class from the instance</li>
</ol>
<p>So by using these ideas, you can create classes with packages; within these classes you can create methods, i.e. the new method as the constructor which creates an instance of the object.</p>
<p>I think the best way to really learn OO Perl, is to start writing some. I will post my OO Perl exploits as they come along.</p>
]]></content:encoded>
			<wfw:commentRss>http://davetang.org/wordpress/2009/12/05/oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl and bioinformatics</title>
		<link>http://davetang.org/wordpress/2009/09/07/perl-and-bioinformatics/</link>
		<comments>http://davetang.org/wordpress/2009/09/07/perl-and-bioinformatics/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 13:42:50 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[computing]]></category>

		<guid isPermaLink="false">http://davetang.org/wordpress/?p=138</guid>
		<description><![CDATA[Recently I posted a question to the Perl beginner mailing list about Perl and bioinformatics. My question was asking why Perl is better than other scripting languages when it comes to working with text. And as a final note in my email, I made a remark towards to how parsing text is useful to biology [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I posted a question to the Perl beginner mailing list about Perl and bioinformatics. My question was asking why Perl is better than other scripting languages when it comes to working with text. And as a final note in my email, I made a remark towards to how parsing text is useful to biology since a lot of biological data is stored in text files.</p>
<p>I had an abundance of answers (some that I am still slowly digesting), and there were several reasons towards Perl&#8217;s superiority in text processing. In no particular order, here were some answers to why Perl is good/great at text parsing:</p>
<p>1. Regexes are first class citizens in Perl, in other languages you must use a library that feels out of place<br />
2. Perl tends to innovate in regexes, adding features (the most popular non-Perl regex library is PCRE, PCRE stands for Perl Compatible Regular Expressions)<br />
3. Perl is weakly typed, which reduces the amount of code you must write. In strongly typed languages you spend a lot of time casting variables into the desired type.<br />
4. Many of the operators like the readline operator (<>) are setup to do what you want with a minimum level of effort, such as a bare readline operator creating the default UNIX filter style (read from stdin if no files are specified on the commandline, otherwise open each file passed on the commandline and read from each of them in turn).<br />
5. The, much maligned, set of special variables also makes this easy (for instance, $ARGV is set to the file currently being read by the construct in the last point).<br />
6. Perl&#8217;s regexes are still better and faster than the compatible libraries. There are many things Perl can do that they can&#8217;t even come close to (my favourite is the /e modifier on s///!).<br />
7. CPAN is another major reason for Perl&#8217;s strength in text processing. There are hundreds if not thousands of modules that parse, mung, generate text in all sorts of forms. just consider how many templaters there are alone.<br />
8. Perl&#8217;s scalar values are designed from the start to be powerful text storage items. they have no fixed limit on size, you can add, cut, shrink, extract, etc directly with operators instead of long winded function calls. the Perl ops and functions are designed to work well together generating concise (a better word and more accurate than terse) code. Perl&#8217;s guts have been optimized over many years and are very fast when doing text munging.</p>
<p>So from what I have gathered Perl&#8217;s regexes give the user power to create complex text parsing abilities and since Perl&#8217;s scalar values can be limitless in size, large chucks of text can be stored and operated upon. It also seems that the special variables and operators available to Perl make it easier to work with text and pattern matching.</p>
<p>And after some further discussion with a Perl guru, I understood the concept of type casting and how Perl&#8217;s many operators assist with writing less code for casting variables. They also mentioned about strongly typed languages like C++ where 10.0 + 5 would result in an error due to addition between a floating point type vs integer type. This was also touched on briefly in the &#8220;How Perl Saved The Human Genome Project&#8221; and how weak casting can be a problem if a variable changes from a number to a character. This often happens as a lot of data is manually handled and human errors do occur.</p>
<p>And just today I corresponded with a fellow bioinformatician who has used Perl for almost 10 years. They wanted to point out that biological data isn&#8217;t just huge genomic files (which makes Perl extremely useful) and as such other scripting languages are just as competent as Perl, which was also a note made by another Perl guru. Apparently Ruby is extremely popular in Japan, and was developed by the Japanese. There is even a BioRuby! But the point is really that for many bioinformatic tasks such as parsing XML files, Perl holds no advantage over other scripting languages. Perl is just popular in bioinformatics because it was there first.</p>
<p>It has been a very insightful thread and I did get a lot out of it. It helped me understand the history of Perl and biology and bioinformatics, and explain why Perl is very suitable in parsing large text files. However I have heard that Perl&#8217;s syntax is hard to read and ugly. I guess when you&#8217;re developing software, readability plays a large part. Besides Perl is known to be quick and dirty and considered to be the Swiss army chainsaw. But hopefully when I get my python bioinformatics book, I can get a better perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://davetang.org/wordpress/2009/09/07/perl-and-bioinformatics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping a mental tab on things</title>
		<link>http://davetang.org/wordpress/2009/07/12/keeping-a-mental-tab-on-things/</link>
		<comments>http://davetang.org/wordpress/2009/07/12/keeping-a-mental-tab-on-things/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 01:39:34 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[DBI]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://davetang.org/wordpress/?p=100</guid>
		<description><![CDATA[So a small project I&#8217;ve been working on involves keeping a list of useful items, i.e. todo lists, grocery lists, etc. I got the idea reading a life hacking post about staying organised by keeping lists. The only difference is that I have chosen to keep tab of my lists in a MySQL database (instead [...]]]></description>
			<content:encoded><![CDATA[<p>So a small project I&#8217;ve been working on involves keeping a list of useful items, i.e. todo lists, grocery lists, etc. I got the idea reading a <a href="http://www.lifehack.org/articles/productivity/9-lists-to-keep-updated-and-keep-handy.html">life hacking post</a> about staying organised by keeping lists. The only difference is that I have chosen to keep tab of my lists in a MySQL database (instead of the funky moleskin notepad) and I will use a simple web interface to view and update my lists.</p>
<p>Since my web hosting company provides MySQL and Perl, along with the DBI module creating this virtual todo list is pretty easy. It&#8217;s just a matter of creating the 9 tables in a database and writing some CGI scripts that will allow a user (me) to insert entries into the database. A word of note is that you should always use taint mode for Perl CGI scripts and untaint any data from web forms before running the SQL query. I&#8217;ve also limited access to the CGI scripts that manipulate the databases for obvious reasons. However I will allow everybody to view my lists, by creating a new MySQL user and granting the user viewing privileges (select privilege).</p>
<p>The nine lists are (if you haven&#8217;t already read the life hacking post):</p>
<ol>
<li>A wish list: if people don&#8217;t know what to buy you for special days
<li>A gift list: awesome gifts to buy people
<li>Minute list: stuff to do if I have a spare minute
<li>BHAGs: Big hairy audacious goals, enough said
<li>Bucket list: stuff to do before you die
<li>Grocery list: a grocery list
<li>Recommended list: stuff people have recommended to me, i.e. books, movies, etc.
<li>Rememeber list: stuff to remember
<li>Ideas list: for when you have that really awesome idea
</ol>
<p>I also plan to import my bookmarks into a database and use this simple web interface to update my favourite sites. Hopefully this will help me keep a mental tab on things.</p>
]]></content:encoded>
			<wfw:commentRss>http://davetang.org/wordpress/2009/07/12/keeping-a-mental-tab-on-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Day 3 of my new regime</title>
		<link>http://davetang.org/wordpress/2009/06/03/day-3-of-my-new-regime/</link>
		<comments>http://davetang.org/wordpress/2009/06/03/day-3-of-my-new-regime/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 13:52:30 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[exercise]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[sleep]]></category>

		<guid isPermaLink="false">http://davetang.org/wordpress/?p=30</guid>
		<description><![CDATA[I have been keeping up my three pillars of health so far; been eating healthier, and much more in general, been sleeping a tad earlier and doing a tad more exercise. And the best thing of it all is that I&#8217;m feeling much better. I&#8217;m more coherent, I feel more energised and in general I [...]]]></description>
			<content:encoded><![CDATA[<p>I have been keeping up my three pillars of health so far; been eating healthier, and much more in general, been sleeping a tad earlier and doing a tad more exercise. And the best thing of it all is that I&#8217;m feeling much better. I&#8217;m more coherent, I feel more energised and in general I feel much better. So definitely reaping the benefits already.</p>
<p>Today was also lab meeting day where I had to present, and although I didn&#8217;t really feel like presenting I felt the talk went well, especially for how much preparation I had. Tonight was also &#8220;State of Origin&#8221; night so I went over to a friend&#8217;s place to watch the game. I don&#8217;t have a great understanding of the game, but it was still good to be more social. For the records, Queensland won tonight due to pretty sloppy play by NSW. I also passed by Borders and purchased Learning Perl The Fifth Edition, which I plan to read from start to finish.</p>
<p>I plan to start from the beginning and move forward to the more advanced Perl programming books. I have decided to be known as a Perl programmer due to the usefulness of the language. Again this is another dedication that I need to keep and although I won&#8217;t push myself too hard so that I burn out, but I will definitely try to keep up with my regular Perl reading. My current knowledge of Perl is just too scattered, and I hope I can start building the foundation towards a strong understanding of the language.</p>
]]></content:encoded>
			<wfw:commentRss>http://davetang.org/wordpress/2009/06/03/day-3-of-my-new-regime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>davetang.org</title>
		<link>http://davetang.org/wordpress/2009/05/31/davetangorg/</link>
		<comments>http://davetang.org/wordpress/2009/05/31/davetangorg/#comments</comments>
		<pubDate>Sun, 31 May 2009 05:56:08 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://davetang.org/wordpress/?p=23</guid>
		<description><![CDATA[So it has been a month and a bit that I have purchased this domain and paid for the web hosting. I haven&#8217;t spent as much time on it as I have wished. My web hosting company actually provides a lot of tools (if tools is the right word to use) for web development. They [...]]]></description>
			<content:encoded><![CDATA[<p>So it has been a month and a bit that I have purchased this domain and paid for the web hosting. I haven&#8217;t spent as much time on it as I have wished. My web hosting company actually provides a lot of tools (if tools is the right word to use) for web development. They provide MySQL, PHP and Perl. Their control panel also makes it idiot proof to install popular internet applications such as WordPress, wiki, etc. I hadn&#8217;t expected this many features, especially since I only paid 80 bucks for the entire package, which includes a year&#8217;s worth of hosting. Perhaps had it been more expensive I would be doing more work on my site, just to get my money&#8217;s worth.</p>
<p>Nevertheless, as with all tasks the hardest thing is just to get started. At least at minimum I am now using the blogging software. I&#8217;ll try to put in a few hours everyday on the site or just update my blog with the catch of the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://davetang.org/wordpress/2009/05/31/davetangorg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
