Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Pure Perl Configuration File
database => 'donut',
user => 'homer',
password => 'simpson',
quote => {
give => 'me',
the => 'number',
for => 911,
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Safe;
my $config = Safe->new->rdo( 'app.conf' );
die "Couldn't parse config file: $@" if $@;
die 'Invalid config file' if not defined $config or ref $config ne 'HASH';
print Dumper $config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment