use YAML; my ($hashref) = Load(<<'...'); --- Home: "$ENV{HOME}" ... print Dump ($hashref);