Skip to content

Instantly share code, notes, and snippets.

@hiroyukim
Created May 5, 2011 06:25
Show Gist options
  • Save hiroyukim/956634 to your computer and use it in GitHub Desktop.
Save hiroyukim/956634 to your computer and use it in GitHub Desktop.
envをふとdumpではかせたくなる瞬間につかうひと
use strict;
use warnings;
use Data::Dumper;
my $app = sub {
my $env = shift;
my $dump = '<html><body><h1>dump env</h1><table style="font-size:normal;">';
$dump .=
join("\n",
map {
'<tr><td style="background-color:#cccccc;">'
. $_
. '</td><td>'
. $env->{$_}
. '</td></tr>'
}
sort { $a cmp $b } keys %$env
);
$dump .= '</table></body></html>';
[200,['Content-Type' => 'text/html'],[$dump]];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment