diff options
author | Yorhel <git@yorhel.nl> | 2008-10-22 16:09:51 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-10-22 16:09:51 +0200 |
commit | c01488dbcf6f8e454c5b8a12c729b9786e5d9333 (patch) | |
tree | da15936fa74e43fab75eea296ea716bceaa24c3e /lib | |
parent | d9cff4fe5e03034ea7321bb5b7d723e45ad2967d (diff) |
Added a useful example, test and debug handler
Yay, we now have a working environment variable dumper at /envdump :D
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/Example.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/VNDB/Handler/Example.pm b/lib/VNDB/Handler/Example.pm new file mode 100644 index 0000000..36f977d --- /dev/null +++ b/lib/VNDB/Handler/Example.pm @@ -0,0 +1,27 @@ + +package VNDB::Handler::Example; + +use strict; +use warnings; +use YAWF; + + +YAWF::register( + qr/envdump/, \&envdump +); + + +sub envdump { + my $self = shift; + $self->resHeader('Content-Type', 'text/plain'); + my $fd = $self->resFd; + + # normally you'd use req* methods to fetch + # environment-specific information... + print $fd "ENV-Dump:\n"; + printf $fd " %s: %s\n", $_, $ENV{$_} for (sort keys %ENV); +} + + +1; + |