Re: nested "if"
From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 07/03/04
- Next message: Randal L. Schwartz: "Re: unique array"
- Previous message: Randy W. Sims: "Re: nested "if""
- In reply to: Michael S. Robeson II: "Re: nested "if""
- Next in thread: Michael S. Robeson II: "Re: nested "if""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Sat, 03 Jul 2004 11:46:55 +0200
Michael S. Robeson II wrote:
> Which of the two "if" statements gets evaluated first? I am trying
> to figure out "in english" what the "if" statements are actually
> doing. Is it saying:
>
> "If a line begins with ">bla-bla" and if $seq (which appears no
> where else in the code other than " $seq="" ") exists assign it to
> the hash "pro" with the name "bla-bla"."
>
> So my question is how does the inner if statement work when seq=""
> is out side that "if" statement?
It's a while loop. For a particular iteration of the loop, $seq and
$name may contain values that were assigned to them during a
*previous* iteration, but the values that will be used in the inner
if-statement during the *current* iteration is not related to what
will happen to those variables later during this same iteration.
> Is the outer "if" statement evaluated first then the inner?
As long as we are talking about the same iteration: No.
> Because how does the inner "if" statement know what "$seq" is?
See above.
HTH
-- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
- Next message: Randal L. Schwartz: "Re: unique array"
- Previous message: Randy W. Sims: "Re: nested "if""
- In reply to: Michael S. Robeson II: "Re: nested "if""
- Next in thread: Michael S. Robeson II: "Re: nested "if""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|