in reply to Hash key ordering?
The only problem that I can see is that the order the keys are returned in might change in a future release. So, I wouldn't rely on that.
#!/usr/bin/perl -wl use strict; my %h1; my %h2; @h1{1..10} = undef; print join " ", keys %h1; @h1{5..10, 1..4} = undef; print join " ", keys %h1; @h2{5..10, 1..4} = undef; print join " ", keys %h2; __END__ Prints: 1 2 3 10 4 5 6 7 8 9 1 2 3 10 4 5 6 7 8 9 1 2 3 4 10 5 6 7 8 9
--
John.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Hash key ordering?
by demerphq (Chancellor) on May 02, 2002 at 12:42 UTC | |
Re: Re: Hash key ordering?
by dargosch (Scribe) on May 02, 2002 at 12:06 UTC |