Not nearly as efficient as delete @hash{101..105}, but the following looks nice:
Unless you keep a sorted list of keys separately, I don't think you can do much better than that.delete @hash{ grep {/^101$/../^105$/} sort keys %hash };
Updated slightly.
- tye (but my friends call me "Tye")In reply to (tye)Re: Removing a certain number of hash keys
by tye
in thread Removing a certain number of hash keys
by myocom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |