#!/bin/env perl use strict; use warnings; use Data::Dumper; my $data = join "",; my $config = eval "{$data}" or die "eval failed, $@"; print Dumper($config); __DATA__ foo => "This is foo's data" , bar => qq{this is bar's data it includes a newline and other stuff} , baz => { bazfoo => "baz is more complex" , bazbar => "it contains a sub-hash" }