saranrsm has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
How do i copy the keys of a hash to an array. I need to know, what is an efficient way of doing it, i.e. without losing much of my memory and my resources.
Yeah, one way of doing it, is to construct a foreach loop for that particular hash and then push each key individually into an array. but is this an efficient way (that uses minimal resources), if not what are the other mean, through which i can accomplish this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copy hash's key to an array
by moritz (Cardinal) on Oct 21, 2011 at 14:13 UTC | |
|
Re: Copy hash's key to an array
by toolic (Bishop) on Oct 21, 2011 at 14:14 UTC | |
|
Re: Copy hash's key to an array
by roboticus (Chancellor) on Oct 21, 2011 at 14:14 UTC | |
|
Re: Copy hash's key to an array
by zwon (Abbot) on Oct 21, 2011 at 14:17 UTC | |
by saranrsm (Acolyte) on Oct 21, 2011 at 16:49 UTC | |
by aaron_baugher (Curate) on Oct 21, 2011 at 18:28 UTC | |
by JavaFan (Canon) on Oct 21, 2011 at 21:11 UTC |