<?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>GeeksPlanet.net &#187; Installing perl</title>
	<atom:link href="http://geeksplanet.net/tag/installing-perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://geeksplanet.net</link>
	<description>C, C++, JAVA, PERL programming for Dummies</description>
	<lastBuildDate>Wed, 24 Feb 2010 11:38:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing perl and writing your first perl program in Ubuntu</title>
		<link>http://geeksplanet.net/2009/06/perl/installing-perl-and-writing-your-first-perl-program-in-ubuntu/</link>
		<comments>http://geeksplanet.net/2009/06/perl/installing-perl-and-writing-your-first-perl-program-in-ubuntu/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 11:43:24 +0000</pubDate>
		<dc:creator>Satish Gandham</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Installing perl]]></category>
		<category><![CDATA[Running a perl program]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://geeksplanet.net/?p=101</guid>
		<description><![CDATA[What Is Perl? Perl is an acronym, short for Practical Extraction and Report Language. It was designed by Larry Wall as a tool for writing programs in the UNIX environment and is continually being updated and maintained by him. For its many fans, Perl provides the best of several worlds. For instance: Perl has the [...]]]></description>
			<content:encoded><![CDATA[<h2><strong>What Is Perl?</strong></h2>
<p>Perl is an acronym, short for <strong>Practical Extraction and Report Language</strong>. It was designed by <strong>Larry Wall</strong> as a tool for writing programs in the UNIX environment and is continually being updated and maintained by him. For its many fans,</p>
<ul>
<li>Perl provides the best of several worlds. For instance: Perl has the power and flexibility of a high-level programming language such as <strong>C</strong>. In fact, as you will see, many of the features of the language are borrowed from C.</li>
<li>Like shell script languages, Perl does not require a special compiler and linker to turn the programs you write into working code. Instead, all you have to do is write the program and tell Perl to run it. This means that Perl is ideal for producing quick solutions to small programming problems, or for creating prototypes to test potential solutions to larger problems.</li>
<li>Perl provides all the features of the script languages <strong>sed</strong> and <strong>awk</strong>, plus features not found in either of these two languages. Perl also supports a <strong>sed-to-Perl</strong> translator and an <strong>awk-to-Perl</strong> translator.</li>
</ul>
<p><strong>In short, Perl is as powerful as C but as convenient as awk, sed, and shell scripts.</strong></p>
<h2><strong>How to install Perl on Ubuntu</strong></h2>
<p>Perl is located in the ubuntu repositories, you can install it by the following command.</p>
<blockquote><p>sudo apt-get install perl</p></blockquote>
<p>perl is installed in usr/bin/<br />
Writing your first perl program</p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/perl
# A simple perl program to print the user input
print (&quot;Hello, type in something\n&quot;);
$inputline=;
print ($inputline);
</pre>
<p>Lets split up the code and see what each line does..<br />
<strong>#!/usr/bin/perl</strong><br />
<strong># </strong>Says this line is a comment and there are no executable instructions on this line<br />
<strong>!</strong> Says this is a perl script<br />
/usr/bin/perl give the location of the perl interpreter, many programing books mention the location as <strong>usr/local/bin/perl</strong>, but this is not correct in ubuntu. In ubuntu Perl interpreter is located at usr/bin/perl.<br />
<strong>print &#8220;Hello, type in something\n&#8221;;</strong><br />
This line just prompts to user to type something, similar to printf statement in C.<br />
<strong>$inputline=&lt;stdin&gt;</strong><br />
Here we are setting a variable named inputline, and storing the input from the keyboard into that variable. &lt;stdin&gt; takes the input from the keyboard.<br />
<strong>print ($inputline);</strong><br />
This line echoes the typed in message.</p>
<h2><strong>Running your first Perl program</strong></h2>
<p>Copy the above above program in to your favorite text editor and save it as <strong>myFirstPerlProgram.pl</strong> and then change it to a executable, you can do that by typing the following in the terminal</p>
<blockquote><p>chmod +x myFirstPerlProgram.pl</p></blockquote>
<p>now you can run this code by typing myFirstPerlProgram.pl in the terminal</p>
<div id="attachment_112" class="wp-caption aligncenter" style="width: 515px"><img class="size-full wp-image-112" title="Running a perl program" src="http://geeksplanet.net/wp-content/uploads/2009/06/perl-program.png" alt="Output of the above perl program" width="505" height="79" /><p class="wp-caption-text">Output of the above perl program</p></div>
]]></content:encoded>
			<wfw:commentRss>http://geeksplanet.net/2009/06/perl/installing-perl-and-writing-your-first-perl-program-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

