<?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>Salomon Johns &#187; perl</title>
	<atom:link href="http://salomonjohns.com/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://salomonjohns.com</link>
	<description>Just a personal blog.</description>
	<lastBuildDate>Wed, 25 Apr 2012 07:49:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Happy New Years</title>
		<link>http://salomonjohns.com/2010/01/happy-new-years/</link>
		<comments>http://salomonjohns.com/2010/01/happy-new-years/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:00:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[new years]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://salomonjohns.com/?p=142</guid>
		<description><![CDATA[Though a few days late, I wish everyone a happy new years and hope that 2010 is a good year for everyone. I look forward to taking classes again here in about 2 weeks. Perl here I come!]]></description>
			<content:encoded><![CDATA[<p>Though a few days late, I wish everyone a happy new years and hope that 2010 is a good year for everyone. I look forward to taking classes again here in about 2 weeks. Perl here I come! <img src='http://salomonjohns.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://salomonjohns.com/2010/01/happy-new-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Second Perl Experiment</title>
		<link>http://salomonjohns.com/2009/09/second-perl-experiment/</link>
		<comments>http://salomonjohns.com/2009/09/second-perl-experiment/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 07:39:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://salomonjohns.com/?p=63</guid>
		<description><![CDATA[After a bit of reading online and book reading (Learning Perl 2nd Edition), I came up with this; #!/usr/bin/perl # Revision 1 - 09-03-09 1530 # Countr Code list, stdin, perl # SRC for codes: http://www.kropla.com/dialcode.htm use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; #reset colors after each line print GREEN "Please enter the country code you [...]]]></description>
			<content:encoded><![CDATA[<p>After a bit of reading online and book reading (<strong>Learning Perl 2nd Edition</strong>), I came up with this;</p>
<pre class="language" style="font-family:monospace;">#!/usr/bin/perl
# Revision 1 - 09-03-09 1530
# Countr Code list, stdin, perl
# SRC for codes: http://www.kropla.com/dialcode.htm

use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1; #reset colors after each line

print GREEN "Please enter the country code you are trying to look up.\n";
$cc = &lt;STDIN&gt;;
chomp $cc;
if ($cc eq "1") {
print GREEN "United States of America or Canada.\n";
}
elsif ($cc eq "93") {
print RED "Afghanistan.\n"; }
elsif ($cc eq "355") {
print RED "Albania.\n"; }
elsif ($cc eq "213") {
print RED "Algeria.\n"; }
elsif ($cc eq "1684") {
print RED "American Samoa.\n"; }
elsif ($cc eq "376") {
print RED "Andorra.\n"; }
elsif ($cc eq "244") {
print RED "Angola.\n"; }
elsif ($cc eq "1268") {
print RED "Antigua.\n"; }
elsif ($cc eq "54") {
print RED "Argentina.\n"; }
elsif ($cc eq "374") {
print RED "Armenia.\n"; }
elsif ($cc eq "297") {
print RED "Aruba.\n"; }
elsif ($cc eq "247") {
print RED "Ascension.\n"; }
elsif ($cc eq "61") {
print RED "Australia.\n"; }
elsif ($cc eq "672") {
print RED "Australian Extrernal Territories.\n"; }
elsif ($cc eq "43") {
print RED "Austra.\n"; }
elsif ($cc eq "994") {
print RED "Azerbaijan.\n"; }
elsif ($cc eq "1242") {
print RED "Bahamas.\n"; }
elsif ($cc eq "973") {
print RED "Bahrain.\n"; }
elsif ($cc eq "880") {
print RED "Bangladesh.\n"; }
elsif ($cc eq "1246") {
print RED "Barbados.\n"; }
elsif ($cc eq "1268") {
print RED "Barbuda.\n"; }
elsif ($cc eq "375") {
print RED "Belarus.\n"; }
elsif ($cc eq "32") {
print RED "Belgium.\n"; }
elsif ($cc eq "501") {
print RED "Belize.\n"; }</pre>
<p>Some of you may find this to be pretty elementary, but lets see what I can come up with in the next day or two. Essentially all this does is looks for a country that matches the code you put in. It does not include all countries, but I think I got the idea of<em> elsif </em>in perl.<br />
<a href="http://salomonjohns.com/img-bin/perl/country-code/country-code.gif" rel="lightbox" title="Second Perl Experiment"><img src="http://salomonjohns.com/img-bin/perl/country-code/country-code.gif" width="293" height="146"></a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://salomonjohns.com/2009/09/second-perl-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experimenting with Perl</title>
		<link>http://salomonjohns.com/2009/09/experimenting-with-perl/</link>
		<comments>http://salomonjohns.com/2009/09/experimenting-with-perl/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 07:52:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fetch]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://salomonjohns.com/?p=56</guid>
		<description><![CDATA[Well, this is my first actual experiment with Perl. All it does is chmod 750 some fetch utilities. In my next build I want to set it up so that if the file exists, and if it doesnt, it will prompt you that the file is not on the system and it is being skipped. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this is my first actual experiment with Perl. All it does is chmod 750 some fetch utilities. In my next build I want to set it up so that if the file exists, and if it doesnt, it will prompt you that the file is not on the system and it is being skipped.</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">#!/usr/bin/perl
# Revision 1 - 09-03-09
# Initial Build
# Chmod 750 of rcp, wget, lynx, links, elinks, scp, nc, ftp, telnet, curl
&nbsp;
print (&quot;Permissions?\n&quot;);
system ('chmod 750 -v /usr/bin/rcp');
system ('chmod 750 -v /usr/bin/wget');
system ('chmod 750 -v /usr/bin/lynx');
system ('chmod 750 -v /usr/bin/links');
system ('chmod 750 -v /usr/bin/elinks');
system ('chmod 750 -v /usr/bin/scp');
system ('chmod 750 -v /usr/bin/nc');
system ('chmod 750 -v /usr/bin/ftp');
system ('chmod 750 -v /usr/bin/telnet');</pre></div></div>

<p>Lets see how this turns out over the next few days.</p>
<p>Update before I go to bed:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">#!/usr/bin/perl
# Revision 1 - 09-03-09 0055
# Initial Build
# Chmod 750 of rcp, wget, lynx, links, elinks, scp, nc, ftp, ssh, telnet, curl
#
# Revision 2 - 09-03-09 0113
# If else statements are in place, they can handle if the file does or does not exist
&nbsp;
print (&quot;Permissions lol...\n&quot;);
$filename = '/usr/bin/wget';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system (&quot;chmod 750 -v '/usr/bin/wget'&quot;);
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/curl';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system (&quot;chmod 750 -v '/usr/bin/curl'&quot;);
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/rcp';
if (-e $filename) {
print &quot;Founds $filename\n&quot;;
system ('chmod 750 -v /usr/bin/rcp');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/lynx';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/lynx');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/elinks';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/elinks');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/scp';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/scp');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/nc';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/nc');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/ftp';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/ftp');
}
else
{ print &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/telnet';
if (-e $filename) {
print &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/telnet');
}
else
{ print &quot;File $filename, not found\n&quot;;</pre></div></div>

<p>}<br />
print &#8220;Permissions set to 750 across the board.\n&#8221;</p>
<p>And now the last revision of the night, colors.</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">#!/usr/bin/perl
# Revision 1 - 09-03-09 0055
# Initial Build
# Chmod 750 of rcp, wget, lynx, links, elinks, scp, nc, ftp, ssh, telnet, curl
#
# Revision 2 - 09-03-09 0113
# If else statements are in place, they can handle if the file does or does not exist
#
# Revision 3 - 09-03-09 0124
# Colors?
&nbsp;
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1; #reset colors after each line, otherwise everything will be green and red
&nbsp;
print (&quot;Permissions lol...\n&quot;);
$filename = '/usr/bin/wget';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system (&quot;chmod 750 -v '/usr/bin/wget'&quot;);
}
else
{
print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/curl';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system (&quot;chmod 750 -v '/usr/bin/curl'&quot;);
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/rcp';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/rcp');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/lynx';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/lynx');
}
else
{
print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/elinks';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/elinks');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/scp';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/scp');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/nc';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/nc');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/ftp';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/ftp');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
$filename = '/usr/bin/telnet';
if (-e $filename) {
print GREEN &quot;Found $filename\n&quot;;
system ('chmod 750 -v /usr/bin/telnet');
}
else
{ print RED &quot;File $filename, not found\n&quot;;
}
print &quot;Permissions set to 750 across the board.\n&quot;</pre></div></div>

<p>Additional reading:<br />
<a href="http://perl.about.com/od/programmingperl/qt/perlexists.htm">http://perl.about.com/od/programmingperl/qt/perlexists.htm</a><br />
<a href="http://perl.active-venture.com/lib/Term/ANSIColor.html">http://perl.active-venture.com/lib/Term/ANSIColor.html</a><br />
<a href="http://www.linuxforums.org/forum/linux-programming-scripting/116383-how-can-i-use-wget-perl.html">http://www.linuxforums.org/forum/linux-programming-scripting/116383-how-can-i-use-wget-perl.html</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://salomonjohns.com/2009/09/experimenting-with-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

