in reply to Storing multiple blocks of text in the __DATA__ section
#!/bin/env perl use strict; use warnings; use Data::Dumper; my $data = join "",<DATA>; 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" }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Storing multiple blocks of text in the __DATA__ section
by blindluke (Hermit) on Jan 02, 2015 at 14:40 UTC |