<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Modern Computer &#187; Perl</title>
	<atom:link href="http://nasvel.wordpress.com/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://nasvel.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 08 Jul 2009 20:25:41 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/77821c03fce1b454c33fc7a192a1af8c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Modern Computer &#187; Perl</title>
		<link>http://nasvel.wordpress.com</link>
	</image>
			<item>
		<title>[Perl] Expect.pm with perl</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-expectpm-with-perl/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-expectpm-with-perl/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 15:21:59 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-expectpm-with-perl/</guid>
		<description><![CDATA[
#!/usr/bin/perl
use warnings;
use Expect;

# connection parameters
$SERVER = 'host';
$USER = 'user';
$PASS = 'pass';

# spawn the date command on $SERVER running as $USER
my $spawn = Expect-&#62;spawn(qq{ssh $USER\@$SERVER date})
or die "Unable to spawn ssh.\n";

$spawn-&#62;debug(2);
$spawn-&#62;log_stdout(0);

# provide the password when prompted, waiting up to 5 seconds
if ($spawn-&#62;expect(5, 'password:')) {
	$spawn-&#62;send($PASS . "\n");
}

# wait for the date and print it out
if ($spawn-&#62;expect(5, -re [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=71&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre>
#!/usr/bin/perl
use warnings;
use Expect;

# connection parameters
$SERVER = 'host';
$USER = 'user';
$PASS = 'pass';

# spawn the date command on $SERVER running as $USER
my $spawn = Expect-&gt;spawn(qq{ssh $USER\@$SERVER date})
or die "Unable to spawn ssh.\n";

$spawn-&gt;debug(2);
$spawn-&gt;log_stdout(0);

# provide the password when prompted, waiting up to 5 seconds
if ($spawn-&gt;expect(5, 'password:')) {
	$spawn-&gt;send($PASS . "\n");
}

# wait for the date and print it out
if ($spawn-&gt;expect(5, -re =&gt; qr/^.*\d{4}.*\n/)) {
	print "The date on $SERVER is " . $spawn-&gt;match();
}
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=71&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-expectpm-with-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Developping CGI with Perl</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-developping-cgi-with-perl/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-developping-cgi-with-perl/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 14:57:57 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-developping-cgi-with-perl/</guid>
		<description><![CDATA[
Useful modules for writing CGI in Perl:

use CGI;
use URI::Escape;


The common document type of the CGI header
Content-type: text/html

Content-type of POST
The common value of &#8220;Content-type&#8221; received from a POST HTML form is &#8220;application/x-www-form-urlencoded&#8221;, although another option for form input (used when submitting files) is &#8220;multipart/form-data&#8221;.


HTTP Authentification
Authorization: Basic dXNlcjpwYXNzd29yZA==
The encoded portion is simply the username and password joined [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=65&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul>
<li>Useful modules for writing CGI in Perl:
<pre>
use CGI;
use URI::Escape;
</pre>
</li>
<li>The common document type of the CGI header
<pre>Content-type: text/html</pre>
</li>
<li>Content-type of POST
<p>The common value of &#8220;Content-type&#8221; received from a POST HTML form is &#8220;application/x-www-form-urlencoded&#8221;, although another option for form input (used when submitting files) is &#8220;multipart/form-data&#8221;.
</p>
</li>
<li>HTTP Authentification
<pre>Authorization: Basic dXNlcjpwYXNzd29yZA==</pre>
<p>The encoded portion is simply the username and password joined with a colon and Base64-encoded.
</li>
<li>Cookies
<pre>
Set-Cookie: cart_id=12345; path=/;expires=Sat,
18-Mar-05 19:06:19 GMT
</pre>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/65/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/65/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=65&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-developping-cgi-with-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Generic perl class</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-generic-perl-class/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-generic-perl-class/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 14:54:32 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-generic-perl-class/</guid>
		<description><![CDATA[
package      Bestiary;
require      Exporter;

our @ISA       = qw(Exporter);
our $VERSION   = 1.00;         # Version number

sub new {
    my $invocant = shift;
    my $class = ref($invocant) &#124;&#124; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=63&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre>
package      Bestiary;
require      Exporter;

our @ISA       = qw(Exporter);
our $VERSION   = 1.00;         # Version number

sub new {
    my $invocant = shift;
    my $class = ref($invocant) || $invocant;
    my $self = { @_ };          # Remaining args become attributes
    bless($self, $class);       # Bestow objecthood
    return $self;
}

1;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=63&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-generic-perl-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Some useful Perl internal functions</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-some-useful-perl-internal-functions/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-some-useful-perl-internal-functions/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 14:51:41 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-some-useful-perl-internal-functions/</guid>
		<description><![CDATA[
alarm n:
sends a SIGALRM signal to the executing Perl program after n seconds
caller [n]:
it returns the package name in a scalar context; in a list context, it returns the package name, filename, and line number from which the currently executing subroutine was called.
pos $scalar:
Returns the location in scalar where the last m//g search over scalarleft [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=62&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul>
<li>alarm n:
<p>sends a SIGALRM signal to the executing Perl program after n seconds</p>
<li>caller [n]:
<p>it returns the package name in a scalar context; in a list context, it returns the package name, filename, and line number from which the currently executing subroutine was called.</p>
<li>pos $scalar:
<p>Returns the location in scalar where the last m//g search over scalarleft off.</p>
<pre>
$grafitto =~ m/word/g;
print pos($grafitto));
</pre>
<li>stat file:
<p>($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks)<br />
 = stat $filename;</p>
<li>truncate file, length:
<p>Truncates a file (given as a filehandle or by name) to the specified length.</p>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/62/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/62/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=62&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-some-useful-perl-internal-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Resizing and truncating an array in Perl</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-resizing-and-truncating-an-array-in-perl/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-resizing-and-truncating-an-array-in-perl/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 14:45:00 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-resizing-and-truncating-an-array-in-perl/</guid>
		<description><![CDATA[Interestingly, assigning to $#array actually changes the size of the array in memory. This allows us both to extend an array without assigning to a higher element and also to truncate an array that is larger
than it needs to be, allowing Perl to return memory to the operating system:

$#array = 999; # extend @array to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=58&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Interestingly, assigning to $#array actually changes the size of the array in memory. This allows us both to extend an array without assigning to a higher element and also to truncate an array that is larger<br />
than it needs to be, allowing Perl to return memory to the operating system:</p>
<pre>
$#array = 999; # extend @array to 1000 elements
$#array = 3; # remove @elements 4+ from array
</pre>
<p> Truncating an array destroys all elements above the new index, so the last example above is a more efficient way to do the following:</p>
<pre>
@array = @array[0..3];
</pre>
<p>This assignment also truncates the array, but by reading out values and then reassigning them. Altering the value of $#array avoids the copy.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=58&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-resizing-and-truncating-an-array-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Use h2xs to create a distribution</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-use-h2xs-to-create-a-distribution/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-use-h2xs-to-create-a-distribution/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 13:40:42 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-use-h2xs-to-create-a-distribution/</guid>
		<description><![CDATA[A distribution contains the module (or collection of related modules), plus all the support files required to document, test, ship, and install the module. While you could potentially construct all these files by hand, it&#8217;s much simpler to use a tool that comes with Perl, awkwardly called h2xs.

$ h2xs -XAn Island::Plotting::Maps
Defaulting to backwards compatibility with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=56&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A distribution contains the module (or collection of related modules), plus all the support files required to document, test, ship, and install the module. While you could potentially construct all these files by hand, it&#8217;s much simpler to use a tool that comes with Perl, awkwardly called h2xs.</p>
<pre>
$ h2xs -XAn Island::Plotting::Maps
Defaulting to backwards compatibility with perl 5.8.0
If you intend this module to be compatible with earlier perl versions, please
specify a minimum perl version with the -b option.

Writing Island/Plotting/Maps/Maps.pm
Writing Island/Plotting/Maps/Makefile.PL
Writing Island/Plotting/Maps/README
Writing Island/Plotting/Maps/t/1.t
Writing Island/Plotting/Maps/Changes
Writing Island/Plotting/Maps/MANIFEST
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=56&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-use-h2xs-to-create-a-distribution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] use Exporter</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-use-exporter/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-use-exporter/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 13:40:14 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-use-exporter/</guid>
		<description><![CDATA[Specialised Import Lists 
If any of the entries in an import list begins with !, : or / then the list is treated as a series of specifications which either add to or delete from the list of names to import. They are processed left to right. Specifications are in the form: 

   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=55&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Specialised Import Lists </p>
<p>If any of the entries in an import list begins with !, : or / then the list is treated as a series of specifications which either add to or delete from the list of names to import. They are processed left to right. Specifications are in the form: </p>
<pre>
    [!]name         This name only
    [!]:DEFAULT     All names in @EXPORT
    [!]:tag         All names in $EXPORT_TAGS{tag} anonymous list
    [!]/pattern/    All names in @EXPORT and @EXPORT_OK which match
</pre>
<p>A leading ! indicates that matching names should be deleted from the list of names to import. If the first specification is a deletion it is treated as though preceded by <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile-big.png' alt=':D' class='wp-smiley' /> EFAULT. If you just want to import extra names in addition to the default set you will still need to include <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile-big.png' alt=':D' class='wp-smiley' /> EFAULT explicitly. </p>
<p> e.g., Module.pm defines: </p>
<pre>
    @EXPORT      = qw(A1 A2 A3 A4 A5);
    @EXPORT_OK   = qw(B1 B2 B3 B4 B5);
    %EXPORT_TAGS = (T1 =&gt; [qw(A1 A2 B1 B2)], T2 =&gt; [qw(A1 A2 B3 B4)]);
</pre>
<p>Remember that most patterns (using //) will need to be anchored with a leading ^, e.g., &#8220;/^EXIT/&#8221; rather than &#8220;/EXIT/&#8221;. </p>
<p>(From manpage Exporter)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=55&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-use-exporter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Perl class : UNIVERSAL</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-perl-class-universal/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-perl-class-universal/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 13:39:13 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-perl-class-universal/</guid>
		<description><![CDATA[As you define classes, you create inheritance hierarchies through the global @ISA variables in each package. To search for a method, Perl wanders through the @ISA tree until it finds a match or fails.
After the search fails however, Perl always looks in one special class called UNIVERSAL and invokes a method from there, if found, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=54&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As you define classes, you create inheritance hierarchies through the global @ISA variables in each package. To search for a method, Perl wanders through the @ISA tree until it finds a match or fails.</p>
<p>After the search fails however, Perl always looks in one special class called UNIVERSAL and invokes a method from there, if found, just as if it had been located in any other class or superclass.</p>
<p>The methods like: $object-&gt;can(&#8230;), $object-&gt;isa(&#8230;) are defined in UNIVERSAL. <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile.png' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=54&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-perl-class-universal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Perl inheritance</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-perl-inheritance/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-perl-inheritance/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 13:36:47 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-perl-inheritance/</guid>
		<description><![CDATA[
package Cow;
use base qw(Animal);

use base has the advantage that it&#8217;s performed at compile time, eliminating a few potential errors from setting @ISA at runtime, like some of the other solutions.

sub speak {
    my $class = shift;
    $class-&#62;SUPER::speak;
}

SUPER::speak means to look in the current package&#8217;s @ISA for speak, invoking the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=53&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre>
package Cow;
use base qw(Animal);
</pre>
<p>use base has the advantage that it&#8217;s performed at compile time, eliminating a few potential errors from setting @ISA at runtime, like some of the other solutions.</p>
<pre>
sub speak {
    my $class = shift;
    $class-&gt;SUPER::speak;
}
</pre>
<p>SUPER::speak means to look in the current package&#8217;s @ISA for speak, invoking the first one found if there&#8217;s more than one.</p>
<p>(From &#8220;Learning Perl Objects, References and Modules&#8221;, O&#8217;Reilly)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=53&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-perl-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
		<item>
		<title>[Perl] Sort the numbers</title>
		<link>http://nasvel.wordpress.com/2006/09/29/perl-sort-the-numbers/</link>
		<comments>http://nasvel.wordpress.com/2006/09/29/perl-sort-the-numbers/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 13:36:00 +0000</pubDate>
		<dc:creator>nasvel</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://nasvel.wordpress.com/2006/09/29/perl-sort-the-numbers/</guid>
		<description><![CDATA[
sort { $a  $b } 1, 10, 9, 8, 20

By default, as Perl orders the items, a string comparison is used. A new comparison is specified using a sort block, placed between the sort keyword and the list of things to sort.
Within the sort block, $a and $b stand in for two of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=52&subd=nasvel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre>
sort { $a  $b } 1, 10, 9, 8, 20
</pre>
<p>By default, as Perl orders the items, a string comparison is used. A new comparison is specified using a sort block, placed between the sort keyword and the list of things to sort.</p>
<p>Within the sort block, $a and $b stand in for two of the items to be sorted. The last evaluated expression must return a -1, 0, or +1 value. If the value is -1, the value currently in $a must appear before the value in $b in the final sorted list. If the value is +1, then the value in $a must appear after the value in $b in the final sorted list. If the value is 0, you don&#8217;t know or can&#8217;t tell, so the results are unpredictable.</p>
<p>For example, to sort those numbers in their proper order, you can use a sort block comparing $a and $b, like so:</p>
<pre>
my @num_sorted = sort {
  if ($a  $b) { +1 }
  else            {  0 }
} 1, 10, 9, 8, 20;
</pre>
<p>also, you can use the spaceship operator instead:</p>
<pre>
my @numerically_sorted = sort { $a  $b }  1, 10, 9, 8, 20;
</pre>
<p>The spaceship operator returns -1, 0, and +1, according to the rules discussed. A descending sort is as simple as reversing the position of $a and $b:</p>
<pre>
my @numerically_descending = sort { $b  $a }  1, 10, 9, 8, 20;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nasvel.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nasvel.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nasvel.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nasvel.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nasvel.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nasvel.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nasvel.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nasvel.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nasvel.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nasvel.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nasvel.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nasvel.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nasvel.wordpress.com&blog=390574&post=52&subd=nasvel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nasvel.wordpress.com/2006/09/29/perl-sort-the-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/825043c1ea9e59400e7a9a8010d18a02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nasvel</media:title>
		</media:content>
	</item>
	</channel>
</rss>