Well, when I use values instead of keys, I get this(not an actual error):

<select name="change_max" class="formfield" onchange="window.location= +(document.max.change_max.value)"> <option value="1">1</option> <option value="10">10</option> <option value="100">100</option> <option value="15">15</option> <option value="20">20</option> <option value="200">200</option> <option selected value="25">25</option> <option value="300">300</option> <option value="35">35</option> <option value="400">400</option> <option value="5">5</option> <option value="50">50</option> <option value="500">500</option> <option value="75">75</option> </select>

That is not correct. Here is the way the values should be instead of the numbers:
<select name="change_max" class="formfield" onchange="window.location= +(document.max.change_max.value)"> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=1">1</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=10">10</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=100">100</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=15">15</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=20">20</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=200">200</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=25">25</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=300">300</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=35">35</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=400">400</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=5">5</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=50">50</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=500">500</option> <option value="http://www.ourgiftcottage.com/index.cgi?pg=admin_main; +load=edit_items;l=0;max=75">75</option> </select>

But that is not in the correct order(I used keys).
Even when I use values instead of keys, It's not in the order I would like...
I want it in order 1-500.

Any Easy way to do that, here is my method:
%max_go_array = ( "$url?pg=$in{pg};load=$in{load};l=$in{l};max=1$include_sess_id" => "1" +, "$url?pg=$in{pg};load=$in{load};l=$in{l};max=5$include_sess_id" => "5" +, "$url?pg=$in{pg};load=$in{load};l=$in{l};max=10$include_sess_id" => "1 +0", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=15$include_sess_id" => "1 +5", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=20$include_sess_id" => "2 +0", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=25$include_sess_id" => "2 +5", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=35$include_sess_id" => "3 +5", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=50$include_sess_id" => "5 +0", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=75$include_sess_id" => "7 +5", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=100$include_sess_id" => " +100", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=200$include_sess_id" => " +200", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=300$include_sess_id" => " +300", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=400$include_sess_id" => " +400", "$url?pg=$in{pg};load=$in{load};l=$in{l};max=500$include_sess_id" => " +500" ); $change_max .= popup_menu(-name=>"change_max", -class=>"formfield", -values=> [sort {$a cmp $b} keys %max_go_array], -labels=> \%max_go_array, -class=>"formfield", -default=>$maxlimit_display, -onchange=>"window.location=(document.max.change_max.value)" );

I would appreciate any advice to help me out...( I'm building this site for my Wife;o) )
I want it to create the popup_menu in the order the array is listed.

thx,
Richard

In reply to Re: Re: Sorting an array II by powerhouse
in thread Sorting an array II by powerhouse

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.