@names = qw(Alice Bob Charlie); print "$_ is a person.\n" for @names; # Prints: # Alice is a person. # Bob is a person. # Charlie is a person. @fruits = qw(Apple Banana Cherry); print shift(@fruits), " is a fruit.\n" while @fruits; # Prints: # Apple is a fruit. # Banana is a fruit. # Cherry is a fruit. $age = 18; print "You can't buy a beer at age $age\n." until ++$age >= 21; print "Congratulations! You can buy beer now, you're twenty-one!\n" if $age == 21; # Prints: # You can't buy a beer at age 19 # You can't buy a beer at age 20 # Congratulations! You can buy beer now, you're twenty-one!