programming-examples/perl/Hash/The delete Function.pl
2019-11-15 12:59:38 +01:00

14 lines
327 B
Perl

Format: delete $ASSOC_ARRAY{KEY}
#!/usr/bin/perl
%employees=(
"Tester" => "Joe",
"Coder" => "Teddy",
"Clerk" => "Tom",
);
$layoff=delete $employees{"Colder"};
print "We had to let $layoff go.\n";
while(($key, $value)=each(%employees)){
print "$key: $value\n";
}