Article View: pl.comp.lang.perl
Article #39837Re: Order of accessing Hash Elements >
From: Piotr Maj
Date: Sun, 24 Oct 2004 08:59
Date: Sun, 24 Oct 2004 08:59
22 lines
1677 bytes
1677 bytes
sriram wrote:
> If i want to retrieve the elements of the hash in the same order at
> which they were inserted what should i do ?
>
> my %myHash = {};
>
> $myHash->{'num1'} = 1;
> $myHash->{'num2'} = 2;
> $myHash->{'num3'} = 3;
>
> I will be happy if somebody can rep. back with some information.
try this module:
http://search.cpan.org/~binkley/Tie-InsertOrderHash-0.01/InsertOrderHash.pm
--
.:. Piotr Maj .:.
.:. pgp 0xA07B0711 .:.
.:. ant -@- kernelpanic.pl .:.
.:. http://kernelpanic.pl/ .:. http://jdn.pl/ .:.
Technical Details
Message-ID:
<clfqu7$50j$00$1@news.t-online.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!newspeer2.se.telia.net!se.telia.net!frankfurt2.telia.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mailReferences:
<e216ebb5.0410231547.7188d5d5@posting.google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!newspeer2.se.telia.net!se.telia.net!frankfurt2.telia.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Piotr Maj <ant@kernelpanic.pl> Newsgroups: pl.comp.lang.perl Subject: Re: Order of accessing Hash Elements > Date: Sun, 24 Oct 2004 10:59:50 +0200 Organization: T-Online Lines: 22 Message-ID: <clfqu7$50j$00$1@news.t-online.com> References: <e216ebb5.0410231547.7188d5d5@posting.google.com> Mime-Version: 1.0 X-Trace: news.t-online.com 1098608391 00 5139 3OiTXAtlC0mYy5G 041024 08:59:51 X-Complaints-To: usenet-abuse@t-online.de X-ID: Vgb5TuZUoeJwpgjId5IpnpII4XZ5DLlTSagxusd8ewd1rCsyGDZo4P User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040918 X-Accept-Language: pl, en-us, en In-Reply-To: <e216ebb5.0410231547.7188d5d5@posting.google.com> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit