Monday, 14 January 2013

Perl Notes - if / while/ for


if / while/ for

( )'s required for test
{ }'s required for statements -- note: not like C
if
if (test) { ... }
if (test) {...} else {...}
if (test) {....} elsif (test2) { ...}
while
while(test) {...}
last – break out of the loop (like break in C)
next – jump to the next ierattion (like continue in C)
for loop – like C

No comments:

Post a Comment