一、条件判断
if - elsif - else
二、循环
while
util
for
foreach
do - while
do - util
goto, last, next, redo
三、单行条件
语法为statement keyword condexpr。其中keyword可为if、unless、while或until,如:
print ("This is zero.
") if ($var == 0);
print ("This is zero.
") unless ($var != 0);
print ("Not zero yet.
") while ($var-- > 0);
print ("Not zero yet.
") until ($var-- == 0);
虽然条件判断写在后面,但却是先执行的。