THanks for the help, it is usefull. But i have another problem that i need to pass more parameters in my array along with the level and department. it could be more than 3-4 now my array is like this : my @array = ({ level => 1,department => 'Office of President', linkdetails = "something"},
{ level => 2, department => 'Recruiting',linkdetails = "something1" },
{ level => 2, department => 'Software',linkdetails="something2"},
etc.....
how will i pass all these information along with the department ?. Actually i want to make on resultant array of
hashes that will contain all the values so that i can
pass to HTML template abd can print there. So level is
also needed so that while printing in HTML page i can multiply the level into number of spaces.
my resultant array of hashes after sorting look like this :

my @array = ({ level => 1, department => 'Office of President',},
{ level => 2, department => 'Pipe line',link="",},
{ level => 2, department => 'Recruiting',link=""},
{ level => 2, department => 'software',link="" },
{ level => 3, department => 'MIS',link="" },
{ level => 3, department => 'System Operations',link="" },
);

need ur help in this ... Thanks

In reply to Re: Re: Logic for sorting of this given array by ravish
in thread Logic for sorting of this given array by ravish

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.