In the book of "Counterexample in Topology", the authors define a scattered space as : "A space is called scattered if it contains no nonempty dense-in-itself subsets", which is different from definition in this post A question on isolated points. Which one is correct? In my understanding, the former does not exclude the case of perfect set and dense-in-itself does not imply perfect.
The definitions are equivalent. Saying that a non-empty set is dense in itself is saying precisely that it has no isolated points. A perfect set is dense in itself, hence not scattered, though you are correct in thinking that a set that is dense in itself need not be perfect.