next up previous contents
Next: for loop Up: 迴圈控制 Previous: 迴圈控制   Contents

while迴圈

shell
	while test
	do
		cmd
	done

perl跟c是一樣的,除了變數用法不一樣

	while (condition) {
		statment1;
	}

	unless (condition) {
		statment1;
	}

C

	while (condition) {
		statment1;
	}

	do {
		statment1;
	} while (condition)



Cyril Huang 2002-06-14