##
@inventory=('2003 abc rel 999',
'1999 hds sdf 100',
'2010 kls pol 1400');
####
$lookfor=;
chop($lookfor);
foreach $inv (@inventory) {
($YEAR,$MAKE,$MODEL,$PRICE)=split(/ /, $inv);
push (@year,$YEAR);
push (@make, $MAKE);
push (@price, $PRICE);
}
if ($lookfor =~ /year/i){
@sorted = sort @year;
print join "\n",@sorted;
print "\n";
}
if ($lookfor =~ /make/i){
@sorted = sort @make;
print join "\n", @sorted;
print "\n";
}