<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-289960167442567338</id><updated>2010-01-02T03:38:45.586-08:00</updated><title type='text'>Amazing Perl</title><subtitle type='html'>The amazing world of perl for engineers!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default?orderby=updated'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default?start-index=26&amp;max-results=25&amp;orderby=updated'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-2464840219480175016</id><published>2009-10-29T03:06:00.000-07:00</published><updated>2009-10-29T03:09:13.182-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exporting'/><title type='text'>Exporting</title><summary type='text'>Having examined the import mechanism from the side of the importer, we can take a look at how modules handle import requests. From the module’s perspective of course, this is exporting. The Exporter module provides a generic import subroutine for modules to configure to their own particular tastes. It handles almost all the possible issues that a module needs to consider, and for many modules it </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/2464840219480175016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/exporting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2464840219480175016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2464840219480175016'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/exporting.html' title='Exporting'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-6019839589276459346</id><published>2009-10-29T03:08:00.001-07:00</published><updated>2009-10-29T03:08:50.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Importing and Exporting'/><title type='text'>Importing from the ‘Exporter’</title><summary type='text'>One advantage of the Exporter module is that the import method it provides is well developed and handles many different situations for us. Even if we decide to provide our own import subroutine we may want to use Exporter too, just for the richness of the features it provides. For example, it accepts regular expressions as well as literal symbol names, which means that we can define a collection </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/6019839589276459346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/importing-from-exporter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6019839589276459346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6019839589276459346'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/importing-from-exporter.html' title='Importing from the ‘Exporter’'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-6659402535027107125</id><published>2009-10-29T03:04:00.001-07:00</published><updated>2009-10-29T03:04:53.686-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Importing and Exporting'/><title type='text'>The ‘import’ Mechanism</title><summary type='text'>Perl’s mechanism for importing symbols is simple, elegant, and shockingly ad hoc, all at the same time. In a nutshell, we call a subroutine called import in the package that we want to import symbols from. The import stage is a secondary stage beyond actually reading and compiling a module file, so it is not handled by the require directive; instead, it is a separate explicit step:

 require My::</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/6659402535027107125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/import-mechanism.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6659402535027107125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6659402535027107125'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/10/import-mechanism.html' title='The ‘import’ Mechanism'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-5874543547969422366</id><published>2009-04-29T22:29:00.000-07:00</published><updated>2009-04-29T22:30:21.688-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Importing and Exporting'/><title type='text'>Importing and Exporting</title><summary type='text'>The term ‘importing’ is used for the process of taking symbols from another package and adding them to our own. From the perspective of the module being imported from, it is ‘exporting’, of course. Either way, the process consists of taking a symbol visible in the namespace of one package and making it visible, without qualification, in another. For example, even if we can see it we would rather </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/5874543547969422366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/importing-and-exporting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5874543547969422366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5874543547969422366'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/importing-and-exporting.html' title='Importing and Exporting'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-1183156215982575307</id><published>2009-04-29T22:26:00.000-07:00</published><updated>2009-04-29T22:28:44.588-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Garbage Collection'/><title type='text'>Two-Phased Garbage Collection</title><summary type='text'>For most purposes, Perl uses a fast and simple reference-based garbage collection system. For this reason, there's an extra dereference going on at some level, so if you haven't built your Perl executable using your C compiler's -O flag, performance will suffer. If you have built Perl with cc -O, then this probably won't matter.A more serious concern is that unreachable memory with a non-zero </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/1183156215982575307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/two-phased-garbage-collection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/1183156215982575307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/1183156215982575307'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/two-phased-garbage-collection.html' title='Two-Phased Garbage Collection'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-779560091365756277</id><published>2009-04-29T22:24:00.001-07:00</published><updated>2009-04-29T22:24:46.237-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Destructors'/><title type='text'>Destructors</title><summary type='text'>When the last reference to an object goes away, the object is automatically destroyed. (This may even be after you exit, if you've stored references in global variables.) If you want to capture control just before the object is freed, you may define a DESTROY method in your class. It will automatically be called at the appropriate moment, and you can do any extra cleanup you need to do. Perl </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/779560091365756277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/destructors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/779560091365756277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/779560091365756277'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/destructors.html' title='Destructors'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-9213947422431654217</id><published>2009-04-29T22:22:00.000-07:00</published><updated>2009-04-29T22:23:25.119-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Methods'/><title type='text'>Method Invocation</title><summary type='text'>There are two ways to invoke a method, one of which you're already familiar with, and the other of which will look familiar. Perl 4 already had an ``indirect object'' syntax that you use when you say     print STDERR "help!!!\n";This same syntax can be used to call either class or instance methods. We'll use the two methods defined above, the class method to lookup an object reference and the </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/9213947422431654217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/method-invocation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/9213947422431654217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/9213947422431654217'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/method-invocation.html' title='Method Invocation'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-9213390475182861026</id><published>2009-04-29T22:21:00.000-07:00</published><updated>2009-04-29T22:22:14.422-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Methods'/><title type='text'>A Method is Simply a Subroutine</title><summary type='text'>Unlike say C++, Perl doesn't provide any special syntax for method definition. (It does provide a little syntax for method invocation though. More on that later.) A method expects its first argument to be the object (reference) or package (string) it is being invoked on. There are just two types of methods, which we'll call class and instance. (Sometimes you'll hear these called static and </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/9213390475182861026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/method-is-simply-subroutine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/9213390475182861026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/9213390475182861026'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/method-is-simply-subroutine.html' title='A Method is Simply a Subroutine'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-2905009091938359770</id><published>2009-04-29T22:19:00.000-07:00</published><updated>2009-04-29T22:21:05.053-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>A Class is Simply a Package</title><summary type='text'>Unlike say C++, Perl doesn't provide any special syntax for class definitions. You use a package as a class by putting method definitions into the class. There is a special array within each package called @ISA, which says where else to look for a method if you can't find it in the current package. This is how Perl implements inheritance. Each element of the @ISA array is just the name of another</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/2905009091938359770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/class-is-simply-package.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2905009091938359770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2905009091938359770'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/class-is-simply-package.html' title='A Class is Simply a Package'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-5365909698006818817</id><published>2008-01-26T06:16:00.000-08:00</published><updated>2009-04-29T03:16:01.843-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Usage'/><title type='text'>Perl to write what??</title><summary type='text'>We all know that when faced with a job to do, we usually tend to reach for the most familiar tool in our belt. And while perl is certainly a versatile tool, it isn't the right tool for every job.Perl is the granddaddy of the open-source scripting languages, with the 1.0 release seeing the light of day way back in 1987. By comparison, PHP wasn't released until 1994, and Python didn't have its 0.9 </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/5365909698006818817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2008/01/perl-to-write-what.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5365909698006818817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5365909698006818817'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2008/01/perl-to-write-what.html' title='Perl to write what??'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-2055744206448092054</id><published>2008-12-09T05:19:00.000-08:00</published><updated>2009-04-29T03:12:16.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='references'/><title type='text'>Perl references</title><summary type='text'>Before release 5 of Perl it was difficult to represent complex data structures, because all references had to be symbolic--and even then it was difficult to refer to a variable instead of a symbol table entry. Perl now not only makes it easier to use symbolic references to variables, but also lets you have ``hard'' references to any piece of data or code. Any scalar may hold a hard reference. </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/2055744206448092054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/perl-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2055744206448092054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2055744206448092054'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/perl-references.html' title='Perl references'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-6255429927620492001</id><published>2008-12-09T05:25:00.001-08:00</published><updated>2009-04-29T03:11:23.684-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='references'/><title type='text'>Making references</title><summary type='text'>References can be created in several ways. Three of them are as follows. By using the backslash operator on a variable, subroutine, or value. (This works much like the &amp; (address-of) operator in C.) This typically creates another reference to a variable, because there's already a reference to the variable in the symbol table. But the symbol table reference might go away, and you'll still have the</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/6255429927620492001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/making-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6255429927620492001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/6255429927620492001'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/making-references.html' title='Making references'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-4381652993255198002</id><published>2007-12-28T02:00:00.002-08:00</published><updated>2009-04-29T03:06:34.430-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scalars'/><title type='text'>Scalars</title><summary type='text'>All numbers and strings are scalars. Scalar variable names start with a dollar sign.Perl converts automatically between numbers and strings as required, so that$a = 2;$b = 6;$c = $a . $b; # The "." operator concatenates two#strings$d = $c / 2;print $d;yields the result 13This example involves converting two integers into strings, concatenating the strings into a new string variable, converting </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/4381652993255198002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/scalars.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/4381652993255198002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/4381652993255198002'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/scalars.html' title='Scalars'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-7616148539381880407</id><published>2009-04-15T22:30:00.000-07:00</published><updated>2009-04-15T22:32:24.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Objects'/><title type='text'>An Object is Simply a Reference</title><summary type='text'>Unlike say C++, Perl doesn't provide any special syntax for constructors. A constructor is merely a subroutine that returns a reference to something ``blessed'' into a class, generally the class that the subroutine is defined in. Here is a typical constructor:     package Critter;    sub new { bless {} }That word new isn't special. You could have written a construct this way, too:     package </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/7616148539381880407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/object-is-simply-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7616148539381880407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7616148539381880407'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/object-is-simply-reference.html' title='An Object is Simply a Reference'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-8380393469013039244</id><published>2009-04-15T22:29:00.000-07:00</published><updated>2009-04-15T22:30:10.307-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Oriented Perl'/><title type='text'>Object Oriented Perl</title><summary type='text'>The next series of posts are on Object Oriented Perl!</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/8380393469013039244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/object-oriented-perl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/8380393469013039244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/8380393469013039244'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/04/object-oriented-perl.html' title='Object Oriented Perl'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-324899720108142626</id><published>2009-02-23T20:04:00.000-08:00</published><updated>2009-02-23T20:12:44.906-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>Perl Classes</title><summary type='text'>There is no special class syntax in Perl, but a package may act as a class if it provides subroutines to act as methods. Such a package may also derive some of its methods from another class (package) by listing the other package name(s) in its global @ISA array (which must be a package global, not a lexical).    package Module;  # assumes Module.pm   use strict;   use warnings;   BEGIN {       </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/324899720108142626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/perl-classes.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/324899720108142626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/324899720108142626'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/perl-classes.html' title='Perl Classes'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-2304721514158696610</id><published>2009-02-05T21:04:00.000-08:00</published><updated>2009-02-05T21:05:32.661-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Package Constructors and Destructors'/><title type='text'>Package Constructors and Destructors</title><summary type='text'>Four special subroutines act as package constructors and destructors. These are the BEGIN, CHECK, INIT, and DESTROY routines. The sub is optional for these routines.A BEGIN subroutine is executed as soon as possible, that is, the moment it is completely defined, even before the rest of the containing file is parsed. You may have multiple BEGIN blocks within a file--they will execute in order of </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/2304721514158696610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/package-constructors-and-destructors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2304721514158696610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2304721514158696610'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/package-constructors-and-destructors.html' title='Package Constructors and Destructors'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-763780984537151715</id><published>2009-02-05T21:01:00.000-08:00</published><updated>2009-02-05T21:03:27.947-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Modules'/><title type='text'>Perl modules</title><summary type='text'>Perl provides a mechanism for alternative namespaces to protect packages from stomping on each other's variables. In fact, there's really no such thing as a global variable in Perl. The package statement declares the compilation unit as being in the given namespace.A module is just a set of related function in a library file a Perl package with the same name as the file. It is specifically </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/763780984537151715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/perl-modules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/763780984537151715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/763780984537151715'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/02/perl-modules.html' title='Perl modules'/><author><name>Murugavel Ganesan</name><email>murugavelganesan@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12768646337384746707'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-7072151388760373245</id><published>2009-01-05T02:09:00.000-08:00</published><updated>2009-01-05T02:10:03.413-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Undefined Values'/><title type='text'>Undefined Values</title><summary type='text'>The undefined value is a curious entity, being neither a scalar, list, hash, nor any other data type, which is essentially the point. Although it isn’t strictly speaking a datatype, it can be helpful to think of it as a special datatype with only one possible value (NULL). The concept of a ‘value that is not a value’ is common to many languages. In Perl, the undef function returns an undefined </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/7072151388760373245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/undefined-values.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7072151388760373245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7072151388760373245'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/undefined-values.html' title='Undefined Values'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-1197875081824947450</id><published>2009-01-05T02:06:00.000-08:00</published><updated>2009-01-05T02:08:20.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TypeGlobes'/><title type='text'>TypeGlobes</title><summary type='text'>The typeglob is a composite data type that contains one instance of each other data types. It is an amalgam of all Perl’s data types, from which it gets its name. It is a sort of ‘super reference’ whose value is not a single reference to something but six slots that can contain six different references, all at once: a.scalar – A reference to scalarb.array – A reference to arrayc.hash – A </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/1197875081824947450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/typeglobes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/1197875081824947450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/1197875081824947450'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/typeglobes.html' title='TypeGlobes'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-5643245739046096988</id><published>2009-01-05T02:01:00.000-08:00</published><updated>2009-01-05T02:05:24.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Structures'/><title type='text'>Complex Data Structures</title><summary type='text'>Combining lists and hashes with references allows us to create arbitrarily complex data structures such as list of lists, hashes of hashes, and lists of hashes of lists of lists and so on. However, Perl lacks the ability to explicitly declare things like multidimensional arrays, because lists and hashes can only contain scalar values. Example 1:# List of list references@arr = ( [1,2], [3,4,5], [</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/5643245739046096988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/complex-data-structures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5643245739046096988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/5643245739046096988'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2009/01/complex-data-structures.html' title='Complex Data Structures'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-7047700616568273290</id><published>2007-12-28T02:00:00.001-08:00</published><updated>2009-01-05T01:56:23.784-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Types'/><title type='text'>Data Types</title><summary type='text'>Perl has a small number of data types. There are only two data types: scalars and arrays. There is also a very special kind of array called an associative array that merits a section all to itself.</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/7047700616568273290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/data-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7047700616568273290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/7047700616568273290'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/data-types.html' title='Data Types'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-2366873615896703331</id><published>2007-12-28T01:58:00.000-08:00</published><updated>2009-01-05T01:55:35.126-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Introduction'/><title type='text'>Introduction</title><summary type='text'>Practical Extraction Reporting Language is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).</summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/2366873615896703331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2366873615896703331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/2366873615896703331'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2007/12/introduction.html' title='Introduction'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-515239008044855085</id><published>2008-12-09T05:26:00.001-08:00</published><updated>2009-01-05T00:19:25.596-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='references'/><title type='text'>Using References</title><summary type='text'>That's it for creating references. By now you're probably dying to know how to use references to get back to your long-lost data. There are several basic methods. 1. Anywhere you'd put an identifier (or chain of identifiers) as part of a variable or subroutine name, you can replace the identifier with a simple scalar variable containing a reference of the correct type:    $bar = $$scalarref;    </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/515239008044855085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/using-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/515239008044855085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/515239008044855085'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/using-references.html' title='Using References'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-289960167442567338.post-4077694470908302953</id><published>2008-12-09T05:27:00.001-08:00</published><updated>2009-01-05T00:17:24.133-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='references'/><title type='text'>Symbolic references</title><summary type='text'>The value of the scalar is taken to be the name of a variable, rather than a direct link to a (possibly) anonymous value.   $name = "foo";  $$name = 1;                 # Sets $foo  ${$name} = 2;               # Sets $foo  ${$name x 2} = 3;           # Sets $foofoo  $name-&gt;[0] = 4;             # Sets $foo[0]  @$name = ();                # Clears @foo  &amp;$name();               # Calls &amp;foo() (as in </summary><link rel='replies' type='application/atom+xml' href='http://amazing-perl.blogspot.com/feeds/4077694470908302953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/symbolic-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/4077694470908302953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/289960167442567338/posts/default/4077694470908302953'/><link rel='alternate' type='text/html' href='http://amazing-perl.blogspot.com/2008/12/symbolic-references.html' title='Symbolic references'/><author><name>Technology Freak</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>