PERL:


PERL: - . 152


5.3.

, keys, values each. , ­, .

delete:

# $ %
delete($X3UI{$KniO4}),

undef undef ${{$} ${$} = undef. ­ $ undef.

delete ­ . keys, each; exists .

undef delete:

# %food_color
sub print_foods {

my @foods = keys %food_color, my $food,

print Keys @foods\n , print Values

foreach $food (@foods) {

my $color = $food_color{$food},

if (defined $color) { print $color ,


5.4. ࠠ 157

} else {

print (undef)

print \n ,

print Initially \n , prmt_foods()

print \nWith Banana undef\n undef $food_color{ Banana }, print_foods(),

print \nWith Banana deleted\n , delete $food_color{ Banana }, print_foods(),

Initially

Keys: Banana Apple Carrot Lemon

Values: yellow red orange yellow

With Banana undef

Keys: Banana Apple Carrot Lemon

Values: (undef) red orange yellow

With Banana deleted Keys Apple Carrot Lemon Values: red orange yellow

, $food_color{ Banana } = undef Banana ­ . ; undef. ­, delete Banana ­ , keys.

delete , ­ .




- -  - -  - -