This is my second good SORT CGI program


$a->{price} <=> $b->{price} || $b->{discount} <=> $a->{discount} 

Nexus           299 USD 0.1
Samsung Galaxy  600 USD 0.8
iPhone          600 USD 0.5