<?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>ramraje.com &#187; Perl If</title>
	<atom:link href="http://www.ramraje.com/tag/perl-if/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ramraje.com</link>
	<description>Software Programming Blog</description>
	<lastBuildDate>Fri, 28 May 2010 17:03:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Perl basics part 3: Control Statements</title>
		<link>http://www.ramraje.com/programming/perl/perl-basics-part-3-control-statements/</link>
		<comments>http://www.ramraje.com/programming/perl/perl-basics-part-3-control-statements/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 11:06:22 +0000</pubDate>
		<dc:creator>Ramraj Edagutti</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl Conditional Statements]]></category>
		<category><![CDATA[Perl conditions]]></category>
		<category><![CDATA[Perl If]]></category>

		<guid isPermaLink="false">http://www.ramraje.com/?p=114</guid>
		<description><![CDATA[In this part of perl basics, we will going to learn about perl control statements such as if, elseif, and else statements etc. If, elseif, and else statements are conditional statements and are executed only if certain condition met.
If Conditional Statements
If statement syntax
$i = 10;
if ($i == 5){
if statements here..
} elseif ($i == 10){
elseif statements [...]]]></description>
			<content:encoded><![CDATA[<p>In this part of perl basics, we will going to learn about perl control statements such as if, elseif, and else statements etc. If, elseif, and else statements are conditional statements and are executed only if certain condition met.<span id="more-114"></span></p>
<h3>If Conditional Statements</h3>
<p>If statement syntax</p>
<blockquote><p>$i = 10;</p>
<p>if ($i == 5){</p>
<p>if statements here..</p>
<p>} elseif ($i == 10){</p>
<p>elseif statements here..</p>
<p>} else {</p>
<p>else statements here..</p>
<p>}</p></blockquote>
<p>In the above code snippet, elseif condition evaluates to true so statements under elseif block will get executed.</p>
<h3>Unless Conditional Statements</h3>
<p>Unless conditional statements are right opposite to if conditions. Unless conditional statements get executed only when certain condition evaluates to false, where as if statements are executed on true condition. And also unless can have else block just like if statements.</p>
<p>Unless syntax</p>
<blockquote><p>unless (conditional_statement){</p>
<p>unless_statements_here;</p>
<p>} else {</p>
<p>else_statements_here;</p>
<p>}</p></blockquote>
<h3>Switch Statements</h3>
<p>Switch statements are not built in perl core modules, you need to import switch module to use it. This is basically used for value-case match, where we have a switch scalar and different case statements and when switch scalar values matches to any of the case value then that particular case statements will get executed.</p>
<p>Switch statement</p>
<blockquote><p>switch ($scalar_value) {</p>
<p>case [$case_value] { statements here..}</p>
<p>case[$case_value] { statements here.. }</p>
<p>else { else_statements here..}</p>
<p>}</p></blockquote>
<p>When any case value matches with switch $scalar_value then that particular case statements are executed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramraje.com/programming/perl/perl-basics-part-3-control-statements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
