Inflationary universe from perfect fluid and $F(R)$ gravity and its comparison with observational data