I have below code to read the parameters and section from my .ini file, but output is not in order. code:
my $config = Config::Tiny->read('SQLdata.ini'); foreach my $section (keys %$config) { print "[$section]\n"; foreach my $parameter (keys %{$config->{$section}}) { print "$parameter = $config->{$section}->{$par +ameter}\n"; } #return $parameter; }
SQLdata.ini has below sections and parameters:
[insert] SQL1 = insert into table <table1> SQL2 = insert into table <table2> SQL3 = insert into table <table3> SQL4 = insert into table <table4> [Truncate] SQL1= truncate table <tablename1> SQL2= truncate table <tablename2> [update] SQL1 = update into <table1> SQL2 = update into <table2> output is: [Truncate] SQL2= truncate table <tablename2> SQL1= truncate table <tablename1> [insert] SQL4 = insert into table <table4> SQL2 = insert into table <table2> SQL3 = insert into table <table3> SQL1 = insert into table <table1> [update] SQL2 = update into <table2> SQL1 = update into <table1>
how can I achieve output in order??

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.