Reference price (quality) is a benchmark point used by consumers to make price (quality) judgements. Combining reference price and reference quality with dynamic pricing and inventory management, this paper applies differential equations theory to construct a optimal control model for perishable products when the quality of products declines exponentially. The demand of products depends on price, quality, reference price and reference quality, among which reference price and reference quality are influenced by consumers’ past memory. The aim is to maximize the retailer’s profit during the period. The conclusions are as follows. Firstly, a optimal dynamic pricing and inventory model for perishable products with reference price and reference quality is constructed, and the model is extended to dual decision variables, stochastic demand, time-dependent effects, competitive and infinite planing horizon setups. Secondly, through the Pontryagin maximum principle, the analytical expression of the optimal dynamic price is derived. Thirdly, a linear search method to solve the optimal static price is proposed. Finally, the sensitivity of the main parameters is analyzed and the corresponding management enlightenments are given. By comparison of dynamic and static pricing, we find that dynamic pricing can achieve more profits and take a shorter selling period. In addition, for the sales problem of perishable products affected by both reference price and reference quality, retailers should adopt skimming pricing strategy (the optimal price decreases with time). Furthermore, to obtain more profit, retails should strive to increase the sensitivity coefficients of two types of reference, and the reference quality memory coefficient, while to decrease the reference price memory coefficient.