点击运行
#!/usr/bin/perl $a = 10; while( $a < 20 ){ if( $a == 15) { # 退出循环 $a = $a + 1; last; } print "a 的值为: $a\n"; $a = $a + 1; }
运行结果 :
正在执行...