<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: What the Llama taught me? Part &#8211; 1</title>
	<atom:link href="http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/</link>
	<description>Used to be something else but now basically contains some useful PHP scripts. That&#039;s all!</description>
	<lastBuildDate>Tue, 18 Oct 2011 23:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: crz</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-73</link>
		<dc:creator><![CDATA[crz]]></dc:creator>
		<pubDate>Thu, 12 Nov 2009 14:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-73</guid>
		<description><![CDATA[@shawncorey In that case some one should point this out to one of the authors. The book is in it&#039;s 5th edition and I can&#039;t believe this went unnoticed till now.]]></description>
		<content:encoded><![CDATA[<p>@shawncorey In that case some one should point this out to one of the authors. The book is in it&#8217;s 5th edition and I can&#8217;t believe this went unnoticed till now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shawnhcorey</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-71</link>
		<dc:creator><![CDATA[shawnhcorey]]></dc:creator>
		<pubDate>Tue, 10 Nov 2009 14:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-71</guid>
		<description><![CDATA[No, they&#039;re not the same.  This is the point I&#039;m trying to make.  In this case, the book is wrong; intervening values do not exist.

This is a problem that is more pronounced with hashes.  It is possible for a hash key to exist but have an undefined value.  The general rule is:  use define() to test for array elements and use exist() to test for hash elements.]]></description>
		<content:encoded><![CDATA[<p>No, they&#8217;re not the same.  This is the point I&#8217;m trying to make.  In this case, the book is wrong; intervening values do not exist.</p>
<p>This is a problem that is more pronounced with hashes.  It is possible for a hash key to exist but have an undefined value.  The general rule is:  use define() to test for array elements and use exist() to test for hash elements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crz</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-70</link>
		<dc:creator><![CDATA[crz]]></dc:creator>
		<pubDate>Tue, 10 Nov 2009 05:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-70</guid>
		<description><![CDATA[Ok, it&#039;s showing &quot;Use of uninitialized value within @fred in print at....&quot;. The Llama said &quot;If Perl needs to create the intervening elements, it creates them as undef values.&quot;. So here should I understand that Perl didn&#039;t find it useful to create the intervening elements, or isn&#039;t this same as undef?]]></description>
		<content:encoded><![CDATA[<p>Ok, it&#8217;s showing &#8220;Use of uninitialized value within @fred in print at&#8230;.&#8221;. The Llama said &#8220;If Perl needs to create the intervening elements, it creates them as undef values.&#8221;. So here should I understand that Perl didn&#8217;t find it useful to create the intervening elements, or isn&#8217;t this same as undef?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-68</link>
		<dc:creator><![CDATA[Shawn]]></dc:creator>
		<pubDate>Mon, 09 Nov 2009 21:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-68</guid>
		<description><![CDATA[7) If you do:

  my @fred = ();
  $fred[999] = &#039;somevalue&#039;;

then $fred[0..998] do not exist.

#!/usr/bin/perl

use strict;
use warnings;

my @fred = ();
$fred[9] = &#039;somevalue&#039;;

for my $i ( 0 .. $#fred ){
  if( exists $fred[$i] ){
    if( defined $fred[$i] ){
      print &quot;\$fred[$i] exists, is defined, and has value $fred[$i]\n&quot;;
    }else{
      print &quot;\$fred[$i] is not defined\n&quot;;
    }
  }else{
    print &quot;\$fred[$i] does not exists\n&quot;;
  }
}


13) Always have a return statement for your sub&#039;s.  That way you always know what is returned.

sub foo {
  return;
}

If foo() is called in a scalar context, undef is returned.  If it is called in a list context, the empty list, (), is returned.

sub bad_return {
  return undef;
}

In a list context, this will return a list of one element: ( undef )  This is not the empty list.


14) All the special Perl variables can be found here: http://perldoc.perl.org/perlvar.html


Plus:

Always `use strict;`  It will cause a fatal compile error for most things you do not want to do.]]></description>
		<content:encoded><![CDATA[<p>7) If you do:</p>
<p>  my @fred = ();<br />
  $fred[999] = &#8216;somevalue&#8217;;</p>
<p>then $fred[0..998] do not exist.</p>
<p>#!/usr/bin/perl</p>
<p>use strict;<br />
use warnings;</p>
<p>my @fred = ();<br />
$fred[9] = &#8216;somevalue&#8217;;</p>
<p>for my $i ( 0 .. $#fred ){<br />
  if( exists $fred[$i] ){<br />
    if( defined $fred[$i] ){<br />
      print &#8220;\$fred[$i] exists, is defined, and has value $fred[$i]\n&#8221;;<br />
    }else{<br />
      print &#8220;\$fred[$i] is not defined\n&#8221;;<br />
    }<br />
  }else{<br />
    print &#8220;\$fred[$i] does not exists\n&#8221;;<br />
  }<br />
}</p>
<p>13) Always have a return statement for your sub&#8217;s.  That way you always know what is returned.</p>
<p>sub foo {<br />
  return;<br />
}</p>
<p>If foo() is called in a scalar context, undef is returned.  If it is called in a list context, the empty list, (), is returned.</p>
<p>sub bad_return {<br />
  return undef;<br />
}</p>
<p>In a list context, this will return a list of one element: ( undef )  This is not the empty list.</p>
<p>14) All the special Perl variables can be found here: <a href="http://perldoc.perl.org/perlvar.html" rel="nofollow">http://perldoc.perl.org/perlvar.html</a></p>
<p>Plus:</p>
<p>Always `use strict;`  It will cause a fatal compile error for most things you do not want to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crz</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-47</link>
		<dc:creator><![CDATA[crz]]></dc:creator>
		<pubDate>Mon, 07 Sep 2009 05:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-47</guid>
		<description><![CDATA[Hi, Psybermonkey,
Thanks. Yeah, I agree &#039;use strict;&#039; construct can sometimes lead a newbie in the path of oblivion. But after first 10 hours or so with Perl, you should immediately start using it. It is Perl&#039;s way of using local variables. It can save you a lot of hassles. Like in the times fREW Schmidt told.
The &#039;use warnings;&#039; construct aids in a different way. It mainly helps you in the case of syntax errors and so. For greater detail you can also use &#039;use diagnostics;&#039;.
People always use the strict and warnings/diagnostics pragma together.]]></description>
		<content:encoded><![CDATA[<p>Hi, Psybermonkey,<br />
Thanks. Yeah, I agree &#8216;use strict;&#8217; construct can sometimes lead a newbie in the path of oblivion. But after first 10 hours or so with Perl, you should immediately start using it. It is Perl&#8217;s way of using local variables. It can save you a lot of hassles. Like in the times fREW Schmidt told.<br />
The &#8216;use warnings;&#8217; construct aids in a different way. It mainly helps you in the case of syntax errors and so. For greater detail you can also use &#8216;use diagnostics;&#8217;.<br />
People always use the strict and warnings/diagnostics pragma together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psybermonkey</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-46</link>
		<dc:creator><![CDATA[Psybermonkey]]></dc:creator>
		<pubDate>Sun, 06 Sep 2009 14:46:43 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-46</guid>
		<description><![CDATA[Christy, nice post, for a newbie to perl like me. 

fREW Schmidt, wouldn&#039;t be using &quot;use warnings;&quot; are more gentle to newbies because i have tried a few times turning on &quot;use strict;&quot; and it throw a bunch of errors to me which i dont understand it. Rather, using &quot;use warnings;&quot;, the suggestions are more gentle and easier to understand.

just my 2 cents.]]></description>
		<content:encoded><![CDATA[<p>Christy, nice post, for a newbie to perl like me. </p>
<p>fREW Schmidt, wouldn&#8217;t be using &#8220;use warnings;&#8221; are more gentle to newbies because i have tried a few times turning on &#8220;use strict;&#8221; and it throw a bunch of errors to me which i dont understand it. Rather, using &#8220;use warnings;&#8221;, the suggestions are more gentle and easier to understand.</p>
<p>just my 2 cents.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chas. Owens</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-45</link>
		<dc:creator><![CDATA[Chas. Owens]]></dc:creator>
		<pubDate>Sat, 05 Sep 2009 23:34:42 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-45</guid>
		<description><![CDATA[brian d foy said:

[He is reading] _Learning Perl_, and he hasn&#039;t got to the point where we tell the reader they don&#039;t need the &amp; in front of subroutine calls. Most of the progression goes from the general rule to the usual case.

I don&#039;t find his argument compelling as I don&#039;t consider &amp;foo() the general rule, but more of an exception to the general case that has magical behavior.]]></description>
		<content:encoded><![CDATA[<p>brian d foy said:</p>
<p>[He is reading] _Learning Perl_, and he hasn&#8217;t got to the point where we tell the reader they don&#8217;t need the &amp; in front of subroutine calls. Most of the progression goes from the general rule to the usual case.</p>
<p>I don&#8217;t find his argument compelling as I don&#8217;t consider &amp;foo() the general rule, but more of an exception to the general case that has magical behavior.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crz</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-43</link>
		<dc:creator><![CDATA[crz]]></dc:creator>
		<pubDate>Sat, 05 Sep 2009 19:29:59 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-43</guid>
		<description><![CDATA[Yeah, You&#039;re right.]]></description>
		<content:encoded><![CDATA[<p>Yeah, You&#8217;re right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brunov</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-42</link>
		<dc:creator><![CDATA[brunov]]></dc:creator>
		<pubDate>Sat, 05 Sep 2009 18:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-42</guid>
		<description><![CDATA[A good rule of thumb that I like to follow is that you should only use $_ in situations where you don&#039;t have to type it out (as Chas. Owens pointed out in his response above). In any other case, using a localized variable is in my opinion cleaner and clearer.]]></description>
		<content:encoded><![CDATA[<p>A good rule of thumb that I like to follow is that you should only use $_ in situations where you don&#8217;t have to type it out (as Chas. Owens pointed out in his response above). In any other case, using a localized variable is in my opinion cleaner and clearer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crz</title>
		<link>http://thejoysofcomputing.wordpress.com/2009/09/05/what-the-llama-taught-me-part-1/#comment-41</link>
		<dc:creator><![CDATA[crz]]></dc:creator>
		<pubDate>Sat, 05 Sep 2009 17:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://thejoysofcomputing.wordpress.com/?p=103#comment-41</guid>
		<description><![CDATA[Point noted. Thanks]]></description>
		<content:encoded><![CDATA[<p>Point noted. Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
