Created
October 26, 2011 10:18
-
-
Save zdk/1315959 to your computer and use it in GitHub Desktop.
load_yml.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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