in reply to Removing a certain number of hash keys
my %h = ( 100 => "a", 101 => "b", 102 => "c", 103 => "d", 104 => "e" );
print join(",", keys %h), "\n";
my $start = 101;
my $stop = 103;
delete @h{ $start .. $stop };
print join(",", keys %h), "\n";
prints
101,102,103,104 101,104
- Comment on Re: Removing a certain number of hash keys
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Removing a certain number of hash keys
by myocom (Deacon) on Dec 12, 2000 at 02:43 UTC | |
by tye (Sage) on Dec 12, 2000 at 02:48 UTC | |
by Hot Pastrami (Monk) on Dec 12, 2000 at 03:00 UTC |