[Courses] [Basics] Lesson #2: Data (II) - Variables, Lists, and a Loop

Liz Young liz at kandew.net
Sun Apr 7 15:16:22 EST 2002


On Saturday 06 April 2002 03:56 am, Sonja Krause-Harder wrote:

> In practice, 'foreach' is used as follows:
> 
> set $people {"Barney" "Fred" "Wilma" "Pebbles" "Dino"}
> 
> foreach person $people {
> 
> 	puts "Hello, $person!\n"
> 
> }

Is that a typo?  To test myself that I learned something in Lesson #1 - 

set \$people {"Barney" "Fred" "Wilma" "Pebbles" "Dino"}
foreach person $$people {
	puts "Hello, $person!\n"
}

Huh!  It works...  :-)  Thanks,

-Liz



More information about the Courses mailing list