#!/opt/QNDperl5.10/bin/perl use warnings; use strict; use 5.010; use Data::Dumper; use Config::General; use Config::Validate; my $schema = { section => { type => 'nested', child => { key => { ## change this to see the code die if 'integer' is used type => 'string', #type => 'integer', }, }, }, }; my $cfgfile = <<'EOF';
key Foo key Bar
EOF my $config = Config::General->new (-String => $cfgfile); print Dumper { $config->getall }; ## you can see the array that Config::General creates Config::Validate->new (schema => $schema)->validate (config => $config); say "Still alive!";