Re: strange construct
Adrian Aichner <[email protected]> 14 Jan 2003 22:36:30 +0100
| Newsgroups | gmane.comp.tex.texi2html.devel |
|---|---|
| Organization | The XEmacs Project |
| Message-ID | <[email protected]> |
>>>>> "Dumas" == Dumas Patrice <[email protected]> writes: Dumas> Hi, Dumas> $name .= ' ' while ($node2sec{$name}); >> >> See .= in the perlop manpage. Dumas> I don't have problem with the .=, but with the while without bloc. Dumas> Is it used instead of an if ? If will execute the assignment statement, then perform the test. Unlike a if statement it's a looping construct. I don't know whether the while test will ever evaluate true more than once through the loop. Dumas> Last, is there a reason why there are so many globally Dumas> scoped variables defined in functions (or should I clean Dumas> that ?) ? >> >> Can you give some examples? Dumas> variables which are global but should in my opinion be Dumas> declared with my and not within a function (in pass1): Dumas> @lines @lines is used in pass1 and pass2 at least. I agree that it could be a lexial variable on top-level, if that's what you are sugggesting. Dumas> @lines2 Dumas> @toc_lines Dumas> .... Dumas> variables which are global but should be lexically scoped, Dumas> examples in pass1 Dumas> $node Dumas> $in_table Dumas> $in_pre $in_pre is also used in sub EnterIndexEntry Perhaps it should become lexically bound and be passed as an argument, as in EnterIndexEntry(..., $in_pre); Dumas> $html_element Dumas> ..... Dumas> Pat Dumas> --------------------------------------------------------------------- Dumas> To unsubscribe, e-mail: [email protected] Dumas> For additional commands, e-mail: [email protected] -- Adrian Aichner mailto:[email protected] http://www.xemacs.org/