This file demonstrates how to initialize variables my ($first, $second); $first = 7; $second = "hello"; print "\$first = $first; \$second = $second\n"; $first = $second; print "\$first = $first; \$second = $second\n"; $first = "wonderful"; $second = 43; print "\$first = $first; \$second = $second\n"; $first = 0; $second = ""; print "\$first = $first; \$second = $second\n"; my (@list, $value, $temp); $list[0] = 3; $list[1] = 4; $list[2] = 0; $list[5] = 6; foreach $value (0 .. $#list) { $temp = defined $list[$value] ? $list[$value] : "undef"; print "\$list[$value] = $temp "; } print "\n"; my (@sublist); @sublist = @list[0..1,5]; foreach $value (0 .. $#sublist) { $temp = defined $sublist[$value] ? $sublist[$value] : "undef"; print "\$sublist[$value] = $temp "; } print "\n"; ($first,$second,@sublist) = @list; print "\$first = $first \$second = $second "; foreach $value (0 .. $#sublist) { $temp = defined $sublist[$value] ? $sublist[$value] : "undef"; print "\$sublist[$value] = $temp "; } print "\n"; my %data; $data{Wilma} = "Betty"; $data{Fred} = "Barney"; $data{Dino} = "Sabertooth"; foreach $value (keys %data) { print "\$data{\'$value\'} = $data{$value} "; } print "\n"; %data = ( "Miami" => "FL", "Boston" => "MA", "New York" => "NY"); foreach $value (keys %data) { print "\$data{\'$value\'} = $data{$value} "; } print "\n"; my $key; while ( ($key,$value) = each %data) { print "City: $key, State: $value "; } print "\n"; This is the output of the program $first = 7; $second = hello $first = hello; $second = hello $first = wonderful; $second = 43 $first = 0; $second = $list[0] = 3 $list[1] = 4 $list[2] = 0 $list[3] = undef $list[4] = undef $list[5] = 6 $sublist[0] = 3 $sublist[1] = 4 $sublist[2] = 6 $first = 3 $second = 4 $sublist[0] = 0 $sublist[1] = undef $sublist[2] = undef $sublist[3] = 6 $data{'Fred'} = Barney $data{'Dino'} = Sabertooth $data{'Wilma'} = Betty $data{'Miami'} = FL $data{'New York'} = NY $data{'Boston'} = MA City: Miami, State: FL City: New York, State: NY City: Boston, State: MA