#!/usr/bin/perl
$,="\n";
while (<>)
{
	chop;
	($itemname, $location, $shelf, $section, $quantity, $cost, $delivery, $price) =split("-");
	$profitmargin = $price - ($cost+$delivery) / $price;
if($quantity < 8) {$leftstring="REORD";}
if($profitmargin <= .10) {$pm = "LOW";}
elsif( $profitmargin < .10  && $profitmargin >= .25) { $pm = "MED";}
else {$pm ="HIGH";}
$profitmargin=15;
write();
}
format STDOUT =
=   @<<<<<<<<<           * @||||||||||||||||||  *           @>>>>>>>>>>>>>> =
    $leftstring,           $itemname,                       $pm
= Quantity            Location                Cost and Profit               =
= on Hand    AI         SH   SE     CO       SP       CH      PM            =
= @|||||||   @>>        @>>  @>>    @###.##  @###.##  @###.## @###%         =
$quantity, $location, $shelf, $section, $cost, $delivery, $price, $profitmargin
.
