- The first concatenates $x and the string ::VERSION then symbolically dereferences, the second symbolically dereferences $x::VERSION
- $y is undefined because $x::VERSION is undefined, perhaps you meant ${ $y = ${ $x . '::VERSION' } }
- because you're passing it as the first argument to print which is expected to be a filehandle if it is not preceded by a comma
If you're interested in dynamically accessing the
$VERSION package variable then check out
UNIVERSAL::VERSION.