Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Parameters not in order by using Config::Tiny

by GotToBTru (Prior)
on Jul 06, 2015 at 13:12 UTC ( [id://1133356]=note: print w/replies, xml ) Need Help??


in reply to Parameters not in order by using Config::Tiny

UPDATE: never mind! Better choice of module as suggested by Corion will solve this issue.

Hashes don't store their keys in order, so that's why (keys %...) returns them in a way you don't expect. For the inner case, replace

(keys %{$config->{$section}})

with

(sort keys %{$config->{$section}}

For the outer loop, perhaps store the sections in array instead of a hash?

Dum Spiro Spero

Replies are listed 'Best First'.
Re^2: Parameters not in order by using Config::Tiny
by bhushanQA (Sexton) on Jul 06, 2015 at 13:34 UTC
    This "(sort keys %{$config->{$section}}" has solved my problem .. Thanks a lot :) good solution

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1133356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found