5.28. Perl redo statement

发布时间 : 2025-10-25 13:33:02 UTC      

Page Views: 9 views

Perl redo statement directly to the first line of the body of the loop to repeat the execution of the loop redo statement after the statement is no longer executed continue statement blocks are no longerexecuted.

continue statement can be used in the while and foreach in a loop.

5.28.1. Grammar #

The syntax format is as follows:

redo [LABEL] 

Among them LABEL is optional.

Labeled modifier LABEL of redo statement indicates that the loop control flow is transferred directly to the label modifier LABEL execution begins at the first line of the associated statement block and no longer executes redo statement and the statement after the continue sentence block;

No label modifier LABEL of redo statement means that the loop control flow is transferred directly to the first line of the current statement block to start execution instead of execution redo statement and the statement after the continue sentence block

If it is in for loop or with continue statement block, then the for incremental list in the loop and continue statement blocks are no longer executed;

5.28.2. Flow chart #

Image0

Example #

#/usr/bin/perl$a=0;while($a<10 ){if($a='=5){$a=$a+1;redo;}print"a' < =$a\\n";}continue{$a=$a+1;} pre>   

Execute the above program, and the output is as follows:

a = 0 a = 1 a = 2 a = 3 a = 4 a = 6 a = 7 a = 8 a = 9 
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。