It is known that compact, perfect, totally disconnected sets are exactly the sets homeomorphic to the ternary Cantor set (cf. Corollary 2-98 in
the book: John G. Hocking and Gail S. Young, Topology, Addison-Wesley Publishing Co., Inc., Reading, Mass.-London, 1961; also see the assertion V on page 226 of the book: F. Hausdorf, Set Theory (translated from the German), AMS Chelsea Publishing, 1957).
Hence, if exist, the required set(s) from the questions would be noncompact.