It's creating a lexical variable $x, and taking a reference of it. Now the name disappears when exiting the block, but since $singleton holds a reference, the value (which in this case is undefined) can still be gotten.
Note that all you need to create an object is a reference. You don't need a reference to a "large" structure like a hash or an array. Any reference will do - including one to a scalar.