Let me try this way as well. (using array)
Will compare the results with the solution I have implemented and will
continue with the one which is faster. :)
Thanks for all your responses!!

Regards,
Kavita :-)


On Wed, Apr 24, 2013 at 4:12 AM, John Delacour <johndelac...@gmail.com>wrote:

> On 23/4/13 at 12:26, kavitahkulka...@gmail.com (kavita kulkarni) wrote:
>
>  Can you help me in finding the most time effective way to retrieve the
>> key-values from hash in the same sequence in which data is inserted into
>> the hash.
>>
>
> What about this? :
>
> #!/usr/bin/perl
> use strict;
> my @array;
> for (
>   {length => 120},  # these are references
>   {width => 120},
>   {height => 220},
>   {weight => 12},
>   {price => 333},
>   ) {
>   push @array, $_;
> }
> for (@array) {
>   for (keys %$_) {print "$_\n"};
> }
>
> # JD
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to