#!/usr/local/bin/perl ############################################################################# # list2: List the ice cream orders - with sorting capabilities ############################################################################# ($sort_by, $asc_desc) = @ARGV; # extract sort arguments $downImage = ""; $upImage = ""; print "Content-type: text/html \n"; print "\n"; $nameOpt = ($sort_by eq "N" && $asc_desc eq "a") ? "N+d" : "N+a"; # toggle $addrOpt = ($sort_by eq "A" && $asc_desc eq "a") ? "A+d" : "A+a"; # asc / $flavOpt = ($sort_by eq "F" && $asc_desc eq "a") ? "F+d" : "F+a"; # / desc if ($sort_by eq "N") { $nameIcon = ($asc_desc eq "a") ? $downImage : $upImage; } if ($sort_by eq "A") { $addrIcon = ($asc_desc eq "a") ? $downImage : $upImage; } if ($sort_by eq "F") { $flavIcon = ($asc_desc eq "a") ? $downImage : $upImage; } print "
Name $nameIcon | Address $addrIcon | Flavor $flavIcon |
---|---|---|
$fname | $address | $flavor |