while loop


Another tool to create a loop is by using while.


while (EXPRESSION) { BLOCK }


my $i = 100;
while ($i > 0) {
    # do something
    $i--;
}


while (1) {
    # a nice infinite loop
}