I&#39;ll take a stab...though this really sounds like test questions copied verbatim... :-\<br><br><div class="gmail_quote">On Fri, Jan 2, 2009 at 8:35 PM,  <span dir="ltr">&lt;<a href="mailto:oak83@cox.net">oak83@cox.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Gents, I need some clarification on these if you do not mind? I am shaky on these. I will try to write these and see what happens. Any input is greatly appreciated.<br>

<br>
What is the value of the expression length(1+2+3) ? &nbsp;5 or 6 or Am I off base?<br></blockquote><div><br>When I ran this snippet of code:<br>&nbsp;&nbsp;&nbsp;&nbsp; printf (&quot;len:%i\n&quot;, length(1+2+3));<br><br>I got back &quot;1&quot;.&nbsp; That sounds right since the <a href="http://perldoc.perl.org">perldoc.perl.org</a> site says that length &quot;returns the length in <i>characters</i> of the value of EXPR&quot;&nbsp; Thus, the math is done first (1+2+3) and results in 6.&nbsp; That value is then converted to a string (&quot;6&quot;), which has a length of 1.&nbsp;<br>
</div><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The expression $a = $b++ * ++$c has the same effect on $a, $b, and $c as which of the following? Think it is the 2nd one?<br>
<br>
$a = $b * $c;<br>
<br>
$a = ($b + 1) * ($c + 1);<br>
<br>
$c = $c + 1; $a = $b * $c; $b = $b + 1;<br>
<br>
$a = $b * ($c + 1);<br>
</blockquote><div><br>I had to double check the Perl.com perlop reference (<a href="http://www.perl.com/doc/manual/html/pod/perlop.html">http://www.perl.com/doc/manual/html/pod/perlop.html</a>), but the C precedence I remembered from CS many years ago still holds.<br>
<br>Since &quot;$b++&quot; means &quot;increment the $b variable AFTER returning it&#39;s current value to the expression using it&quot;, and &quot;++$c&quot; means &quot;increment $c and return the new value to the expression.&quot;&nbsp; Since the ++ are tightly bound to the variable, the multiply doesn&#39;t affect the overall value, so the third example:<br>
&nbsp;&nbsp;&nbsp;&nbsp; $c = $c + 1; $a = $b * $c; $b = $b + 1;<br>Is a different way to write it.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">When is this logical expression true: lc($a) eq $a ? &nbsp; Think it is the 3rd one?<br>

<br>
Never<br>
<br>
Always<br>
<br>
When $a contains no uppercase letters<br>
<br>
When $a contains no lowercase letters</blockquote><div><br>The third one.<br><br>I think that&#39;s enough for now. &nbsp; I didn&#39;t see you have submitted a dozen questions...&nbsp; My initial instinct that these are test questions is feeling more certain.<br>
<br>If this was some sort of a take-home test, how hard would it be to write a small bit of code to test each one if you&#39;re not 100% sure? (That&#39;s what I did on the $b++ * ++$c question...)<br><br>If this isn&#39;t a test, why not point us toward the source code you&#39;re debugging and it might make more sense.<br>
<br>Dan<br clear="all"></div></div><br>-- <br>&quot;Quis custodiet ipsos custodes?&quot; (Who can watch the watchmen?) -- from the Satires of Juvenal<br>&quot;I do not fear computers, I fear the lack of them.&quot; -- Isaac Asimov (Author)<br>
** *** ***** ******* *********** *************<br>