@ages = (15, 18, 24); foreach $age (@ages) { print "At age $age you ", ($age >= 21 ? "can" : "can't"), " buy a beer.\n"; }