Hamlet: To me [Denmark] is a prison.
Rosencrantz: Why then your ambition makes it one. 'Tis too narrow for your mind.
Hamlet: O God, I could be bounded in a nutshell, and count myself a king of infinite space—were it not that I have bad dreams.
Guildenstern: Which dreams indeed are ambition, for the very substance of the ambitious is merely the shadow of a dream.
The common interpretation of this (at least on the Internet) is that Hamlet is pretending to be thwarted by the fact that his uncle, and not he, got the throne after his father's death; and the gullible R&G fall for the pretense. But he's talking about something much darker, of course - being imprisoned by the knowledge of his father's murder and his own need to both cope with the horror and avenge him.
On a surface level, it works pretty well for perfectionism, though - in the sense that often it's the comparison between what we have, and the perfectionist things we want/expect for ourselves, that causes problems.
The excerpt also reminds me of the famous quote by Yeats (later borrowed by Delmore Schwartz): "In dreams begin responsibilities."