GaijinPunch has asked for the wisdom of the Perl Monks concerning the following question:
My other option would be to use dynamic variable names for hashes, but I've read many places that this isn't wise. If anyone can think of anyting I'm missing, I'd love to hear it.sub clean_hash { while ( ( my $key, my $value ) = each %hash ) { + delete $hash{$key}; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Clean out da hash...
by leriksen (Curate) on Feb 12, 2004 at 08:16 UTC | |
Re: Clean out da hash...
by ysth (Canon) on Feb 12, 2004 at 08:16 UTC | |
by GaijinPunch (Pilgrim) on Feb 12, 2004 at 08:28 UTC | |
by ysth (Canon) on Feb 12, 2004 at 08:53 UTC | |
by GaijinPunch (Pilgrim) on Feb 12, 2004 at 09:23 UTC | |
by leriksen (Curate) on Feb 12, 2004 at 09:43 UTC | |
by ysth (Canon) on Feb 12, 2004 at 09:27 UTC | |
by Abigail-II (Bishop) on Feb 12, 2004 at 09:57 UTC | |
by boo_radley (Parson) on Feb 12, 2004 at 15:12 UTC | |
Re: Clean out da hash...
by calin (Deacon) on Feb 12, 2004 at 12:08 UTC | |
by davido (Cardinal) on Feb 12, 2004 at 17:02 UTC | |
by GaijinPunch (Pilgrim) on Feb 13, 2004 at 00:19 UTC |