Skip to content

Instantly share code, notes, and snippets.

@zdk
Created October 26, 2011 10:18
Show Gist options
  • Save zdk/1315959 to your computer and use it in GitHub Desktop.
Save zdk/1315959 to your computer and use it in GitHub Desktop.
load_yml.pl
use YAML;
# Load a YAML stream of 3 YAML documents into Perl data structures.
my ($hashref, $arrayref, $string) = Load(<<'...');
error_handler:
actions:
# Note that Email is only provided here as an example, it does not
# exist.
- type: Email
id: email-devel
to: andreas@example.com
subject: __MYAPP__ errors:
- type: Log
id: log-server
level: error
handlers:
5xx:
template: root/error/5xx.tt
actions:
- email-devel
- log-server
500:
template: root/error/500.tt
actions:
- log-server
fallback:
static: root/static/error.html
actions:
- email-devel
...
use Data::Dumper;
print Dumper($string, $arrayref, $hashref);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment