<?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>Perl script search &#124; Perl programming &#124; Perl Tutorial&#187; perl subroutine</title>
	<atom:link href="http://www.perlscriptsearch.com/category/perl-programming/perl-subroutine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.perlscriptsearch.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Jun 2011 13:22:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How do you pass (and dereference) an array of hashes to a Perl subroutine?</title>
		<link>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/how-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine/</link>
		<comments>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/how-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 07:09:24 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[perl subroutine]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[cell1]]></category>

		<guid isPermaLink="false">http://www.perlscriptsearch.com/perl-programming/perl-subroutine/how-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine/</guid>
		<description><![CDATA[I though the code below would work but I think it is not dereferencing the array: #!/usr/bin/perl # ARRAY OF HASHES $val[0]{&#8216;CELL1&#8242;} = &#34;0cell1&#34;; $val[0]{&#8216;CELL2&#8242;} = &#34;0cell2&#34;; $val[1]{&#8216;CELL1&#8242;} = &#34;1cell1&#34;; $val[1]{&#8216;CELL2&#8242;} = &#34;1cell2&#34;; for my $i (0..$#val) { print &#34;$val[$i]{&#8216;CELL1&#8242;} $val[$i]{&#8216;CELL2&#8242;}\n&#34;; } $res = &#38;mysub(\@val); print &#34;RESULT: $res\n&#34;; sub mysub { my $ref = shift [...]]]></description>
			<content:encoded><![CDATA[<p>I though the code below would work but I think it is not dereferencing the array:</p>
<p>#!/usr/bin/perl</p>
<p># ARRAY OF HASHES<br />
$val[0]{&#8216;CELL1&#8242;} = &quot;0cell1&quot;;<br />
$val[0]{&#8216;CELL2&#8242;} = &quot;0cell2&quot;;<br />
$val[1]{&#8216;CELL1&#8242;} = &quot;1cell1&quot;;<br />
$val[1]{&#8216;CELL2&#8242;} = &quot;1cell2&quot;;</p>
<p>for my $i (0..$#val) {<br />
print &quot;$val[$i]{&#8216;CELL1&#8242;} $val[$i]{&#8216;CELL2&#8242;}\n&quot;;<br />
}</p>
<p>$res = &amp;mysub(\@val);<br />
print &quot;RESULT: $res\n&quot;;</p>
<p>sub mysub {<br />
my $ref = shift ; # $ref is a reference to an array of HASHES<br />
my @valIN=@{$ref}; # try to dereference it</p>
<p>for my $i (0..$#valIN) {<br />
print &quot;$valIN[$i]{&#8216;CELL1&#8242;} $valIN[$i]{&#8216;CELL2&#8242;}\n&quot;;<br />
}</p>
<p>return &quot;DONE&quot;;<br />
}</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d744').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d744" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;submitHeadline=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;title=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;title=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;title=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;bm_description=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;T=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;title=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;title=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F+@+http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fhow-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine%2F&amp;t=How+do+you+pass+%28and+dereference%29+an+array+of+hashes+to+a+Perl+subroutine%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d744').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d744').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/how-do-you-pass-and-dereference-an-array-of-hashes-to-a-perl-subroutine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I Need Perl Programming Help!?</title>
		<link>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-need-perl-programming-help-2/</link>
		<comments>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-need-perl-programming-help-2/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:17:53 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[perl subroutine]]></category>
		<category><![CDATA[alignment score]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[chomp]]></category>
		<category><![CDATA[dashes]]></category>
		<category><![CDATA[dna]]></category>
		<category><![CDATA[fasta]]></category>
		<category><![CDATA[file1]]></category>
		<category><![CDATA[gap]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[perl program]]></category>
		<category><![CDATA[score matrix]]></category>
		<category><![CDATA[score sequences]]></category>
		<category><![CDATA[subroutine]]></category>

		<guid isPermaLink="false">http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-need-perl-programming-help-2/</guid>
		<description><![CDATA[the question is: Write a Perl program that scores an alignment using the scoring matrix in the file &#34;matrix.txt&#34;. Assume that the alignment is stored in FASTA format in the file &#34;dna.fasta&#34;. The program should print the alignment score as output. The file matrix.txt contains this input: 10 -1 2 1 -1 9 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>the question is:<br />
Write a Perl program that scores an alignment using the scoring matrix in the file<br />
&quot;matrix.txt&quot;. Assume that the alignment is stored in FASTA format in the file<br />
&quot;dna.fasta&quot;. The program should print the alignment score as output.</p>
<p>The file matrix.txt contains this input:<br />
10  -1   2   1<br />
-1   9   1   2<br />
 2   1  11  -1<br />
 1   2  -1  12</p>
<p>The file dna.fasta contains this input:<br />
&gt;human<br />
ACCGTTAAG<br />
&gt;mouse<br />
&#8211;CGTTCA-</p>
<p>(the dashes &#8216;-&#8217; represents blanks or spaces)</p>
<p>I think what they are basically asking is to I use the following input in matrix.txt:<br />
    A      C     G     T<br />
A   10    -1     2     1<br />
C   -1     9     1     2<br />
G   2      1    11    -1<br />
T   1      2    -1    12</p>
<p>to score the input in dna.fasta, and then print out the alignment score. Also, they want these done in a subroutine.</p>
<p>I have the main code and the subroutine, but they seem to be combined all wrong and so cant perform the whole task.</p>
<p>@matrix=();<br />
&amp;getmatrix(&quot;matrix.txt&quot;,\@matrix);<br />
@sequences=(); @names=();<br />
&amp;get_dna_score(&quot;dna.fasta&quot;, \@sequences, \@names);<br />
$score=$score(\@sequences, \@matrix);<br />
print $score;</p>
<p>@matrix= ( );<br />
&amp;getmatrix (&quot;matrix.txt&quot;,\@matrix );<br />
for(my$i=0; $i&lt;4; $i++)<br />
       {<br />
         for (my$j=0; $j&lt;4; $j++)<br />
         {<br />
             print $matrix[$i][$j] .&quot; &quot;;<br />
         }<br />
         print &quot;\n&quot;;<br />
       }</p>
<p>sub getmatrix<br />
{<br />
  open (IN, $_[0]);<br />
  my $ref=$_[1];<br />
$i=0;<br />
  while(&lt;IN&gt;)<br />
  {<br />
@s=split(/\s+/, $_);<br />
       for (my$j=0; $j&lt;@s; $j++)<br />
       {<br />
         $$ref[$i][$j]=$s[$j];<br />
       }<br />
       $i++;<br />
  }<br />
  close(IN);<br />
  return;<br />
}</p>
<p>use strict;<br />
use warnings;</p>
<p>open(IN, &quot;dna.fasta&quot;);<br />
my @file1=&lt;IN&gt;;<br />
chomp($file1[1]);<br />
chomp($file1[3]);<br />
close IN;</p>
<p>sub get_dna_score {<br />
     my @first_arr = split //, shift;<br />
     my @second_arr = split //, shift;<br />
     my $match = shift;<br />
     my $miss = shift;<br />
     my $gap = shift;<br />
     my $score = 0;<br />
     my ($i, $len);<br />
     if (scalar @first_arr != scalar @second_arr) {<br />
         die &quot;Can&#8217;t compare strings with different length!\n&quot;;<br />
     }<br />
     for ($i = 0, $len = scalar @first_arr; $i &lt; $len; ++$i) {<br />
         if ($first_arr[$i] eq $second_arr[$i]) {<br />
             $score += $match;<br />
         } elsif ($first_arr[$i] eq &quot; &quot; || $second_arr[$i] eq &quot; &quot;) {<br />
             $score += $gap;<br />
         } else {<br />
             $score += $miss;<br />
         }<br />
     }<br />
     return $score;<br />
}</p>
<p>print get_dna_score($file1[1], $file1[3], 2, -1, -2), &quot;\n&quot;;</p>
<p>Please Help!!!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d563').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d563" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;submitHeadline=I+Need+Perl+Programming+Help%21%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;title=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;title=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;title=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;bm_description=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;T=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;title=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;title=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+I+Need+Perl+Programming+Help%21%3F+@+http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-need-perl-programming-help-2%2F&amp;t=I+Need+Perl+Programming+Help%21%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d563').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d563').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-need-perl-programming-help-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I didn&#039;t learn jack with an information systems degree?</title>
		<link>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-didnt-learn-jack-with-an-information-systems-degree/</link>
		<comments>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-didnt-learn-jack-with-an-information-systems-degree/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 18:38:53 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[perl subroutine]]></category>
		<category><![CDATA[big picture]]></category>
		<category><![CDATA[computer programmer]]></category>
		<category><![CDATA[decipher]]></category>
		<category><![CDATA[internship]]></category>
		<category><![CDATA[job description]]></category>
		<category><![CDATA[local university]]></category>
		<category><![CDATA[new job]]></category>
		<category><![CDATA[questbook]]></category>
		<category><![CDATA[subroutine]]></category>
		<category><![CDATA[web page]]></category>

		<guid isPermaLink="false">http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-didnt-learn-jack-with-an-information-systems-degree/</guid>
		<description><![CDATA[Ok I just started a job as a computer programmer and it is very apparent I am no where need the level needed to start at the entry level. The job description said extensive knowledge of perl, PHP, XML, HTML and it is very apparent to me now that I know a lot less than [...]]]></description>
			<content:encoded><![CDATA[<p>Ok I just started a job as a computer programmer and it is very apparent I am no where need the level needed to start at the entry level. </p>
<p>The job description said extensive knowledge of perl, PHP, XML, HTML and  it is very apparent to me now that I know a lot less than I thought I knew.</p>
<p>I had done an internship monitoring a small web page for my local university. There wasn&#8217;t much code on it. I had added a small questbook using perl, but it wasn&#8217;t anything fancy.</p>
<p>I am completely overwelmed in my new job. Trying to read the code my project manager has is like trying to decipher greek. It is way above my head. I have spent two days looking up commands I don&#8217;t know, but I can&#8217;t learn this all until the project is due.</p>
<p>I have read and worked on small projects in classes, but nothing this large. It is huge! I am tearing my hair out trying to sift through 100+ pages of code and trying to fiqure out how each module and subroutine fits into the big picture. What should I do?</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d552').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d552" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;submitHeadline=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;title=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;title=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;title=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;bm_description=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;T=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;title=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;title=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F+@+http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-didnt-learn-jack-with-an-information-systems-degree%2F&amp;t=I+didn%26%2339%3Bt+learn+jack+with+an+information+systems+degree%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d552').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d552').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-didnt-learn-jack-with-an-information-systems-degree/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple code but wierd Perl behavior. Why does this happen?</title>
		<link>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/simple-code-but-wierd-perl-behavior-why-does-this-happen/</link>
		<comments>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/simple-code-but-wierd-perl-behavior-why-does-this-happen/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 15:54:07 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[perl subroutine]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[chomp]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[single line]]></category>
		<category><![CDATA[subroutine]]></category>

		<guid isPermaLink="false">http://www.perlscriptsearch.com/perl-programming/perl-subroutine/simple-code-but-wierd-perl-behavior-why-does-this-happen/</guid>
		<description><![CDATA[Hello. I have a very simple subroutine that opens a file and reads the lines into an array, then prints out the array text. (I&#8217;m experimenting with arrays &#8211; not planning to print out all the lines directly so please don&#8217;t tell me how to do that). sub printFile{ my ($file) = @_; open(HANDLE, &#34;&#60; [...]]]></description>
			<content:encoded><![CDATA[<p>Hello. I have a very simple subroutine that opens a file and reads the lines into an array, then prints out the array text. (I&#8217;m experimenting with arrays &#8211; not planning to print out all the lines directly so please don&#8217;t tell me how to do that).</p>
<p>sub printFile{<br />
my ($file) = @_;<br />
open(HANDLE, &quot;&lt; $file&quot;) || die(&quot;Failed to open file!&quot;);<br />
while(@line = &lt;HANDLE&gt;){<br />
chomp(@line);<br />
print @line;<br />
}<br />
close(HANDLE);<br />
}</p>
<p>So when I run the code it shows only one line of it that changes as it prints out the text and then it finishes with the last line shown. I would have expected it to fill the whole console window with text, but all it does is update a single line.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d542').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d542" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;submitHeadline=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;title=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;title=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;title=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;bm_description=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;T=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;title=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;title=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F+@+http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fsimple-code-but-wierd-perl-behavior-why-does-this-happen%2F&amp;t=Simple+code+but+wierd+Perl+behavior.+Why+does+this+happen%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d542').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d542').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/simple-code-but-wierd-perl-behavior-why-does-this-happen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I want to write a subroutine to comparing the length of two sequences ( return 1 if 1st seq longer than 2nd se?</title>
		<link>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se/</link>
		<comments>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 18:13:34 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[perl subroutine]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[subroutine]]></category>

		<guid isPermaLink="false">http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se/</guid>
		<description><![CDATA[programming in perl i write it this way but its not working i dont know why &#8230; and i didnt under stand your way of doing it use strict; # i am just writing this as an example to test my subroutine my $firstSeq = &#34;AGTUUUU&#34;; my $secondSeq = &#34;AGGG&#34;; print &#34;my result =&#34;, comparing [...]]]></description>
			<content:encoded><![CDATA[<p>programming in perl<br />
i write it this way  but its not working i dont know why <img src='http://www.perlscriptsearch.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> &#8230;  and i didnt under stand your way of doing it</p>
<p>use strict;</p>
<p># i am just writing this as an example to test my subroutine</p>
<p> my $firstSeq = &quot;AGTUUUU&quot;;<br />
 my $secondSeq = &quot;AGGG&quot;;<br />
 print &quot;my result =&quot;, comparing ($firstSeq,$secondSeq),&quot;\n&quot;;</p>
<p>sub comaring {</p>
<p> my $firstSeq = @_;<br />
 my $secondSeq = @_;<br />
 my $firtslength = length($firstSeq);<br />
 my $secondlength = length($secondSeq);</p>
<p> # can i do this?   if (length($firstSeq) &gt; length($secondSeq)){</p>
<p>   if ($firtslength  &gt; $secondlength){<br />
   print &quot;1 \n&quot;;<br />
  }</p>
<p>   elsif ($firtslength == $secondlength){<br />
   print &quot;0 \n&quot;; </p>
<p>  }</p>
<p>   elsif ($firtslength &lt; $secondlength){<br />
   print &quot;-1 \n&quot;; </p>
<p> }</p>
<p>}</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d531').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d531" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;submitHeadline=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;title=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;title=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;title=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;bm_description=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;T=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;title=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;title=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F+@+http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.perlscriptsearch.com%2Fperl-programming%2Fperl-subroutine%2Fi-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se%2F&amp;t=I+want+to+write+a+subroutine+to+comparing+the+length+of+two+sequences+%28+return+1+if+1st+seq+longer+than+2nd+se%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.perlscriptsearch.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d531').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d531').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.perlscriptsearch.com/perl-programming/perl-subroutine/i-want-to-write-a-subroutine-to-comparing-the-length-of-two-sequences-return-1-if-1st-seq-longer-than-2nd-se/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/35 queries in 0.104 seconds using disk: basic
Object Caching 1518/1617 objects using disk: basic

Served from: www.perlscriptsearch.com @ 2011-10-27 13:31:42 -->
