Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: simplifying a CGI param request

by sulfericacid (Deacon)
on Apr 07, 2006 at 17:28 UTC ( #541935=note: print w/replies, xml ) Need Help??


in reply to Re^3: simplifying a CGI param request
in thread simplifying a CGI param request

This could work or you could drop the "q" from the hash key and then just do a numeric sort on the hash and add it back in at the end.


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re^5: simplifying a CGI param request
by chargrill (Parson) on Apr 07, 2006 at 18:55 UTC

    Or you could sort it thusly:

    foreach $key( map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { m/q(\d+)/; [ $1, $_ ] } keys %hash ){ print "$key : $hash{$key}\n"; }

    (untested)



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://541935]
help
Chatterbox?
[Discipulus]: ridiculous! i'm leading the montly best section. oh tempora oh mores..
[Corion]: :-D
[Eily]: congrats Discipulus :)
[Eily]: (somehow I just typed "cong" and chrome proposed to complete the message :D )
[shmem]: Discipulus: well, a node with just one glaring truth on it is most easily upvoted ;-)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-04-26 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (473 votes). Check out past polls.