It seems that the phrase "perfect" is not standardized in the literature. Many authors (see e.g. Wikipedia) define a subset $S$ of a topological space $M$ to be perfect if $S$ is closed in $M$ and each $x \in S$ is a cluster point of $S$. This is a "relative concept" defined for subsets of an ambient space $M$.
Pugh introduces an "absolute concept" of a perfect space by requiring that all of its points are cluster points. No ambient space is involved here. For the sake of distinction let us use the phrase "a-perfect" in this case. This is just an ad hoc notation.
The relationship between the two concepts is simple:
A space $M$ is a-perfect if and only if $M$ is a perfect subset of itself.
Each perfect subset $S$ of a space $M$ is an a-perfect space when endowed with the subspace topology (for a metric space $M$, $S$ will be endowed with the metric inherited from $M$).
A subset $S \subset M$ which is an a-perfect space is not necessarily a perfect subset of $S$ because it may not be closed. As an example consider $S = (0,1) \subset M = \mathbb R$.
Here is your misunderstanding:
But if we consider a perfect set $S \subset M$, then $S = S'$ where $S'$ is the set of cluster points of $S$.
This is not true. The set $S'$ of cluster points of $S$ in $M$ is in general bigger than the set of cluster points of $S$ in itself - be aware of the conflict between the absolute and relative concepts of cluster points. Thus we have $S \subset S'$ for subsets which are a-perfect and $S = S'$ iff $S$ is closed and a-perfect.