From: Matt S Trout Date: Fri, 23 Sep 2011 08:55:14 +0000 (+0000) Subject: output status+headers to STDERR in CLI mode X-Git-Tag: v0.009~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=baabba332e5b851f5d1b67746f47ac69daa0d422 output status+headers to STDERR in CLI mode --- diff --git a/Changes b/Changes index e20ebdb..17a41e0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Change log for Web::Simple + - Change CLI mode to print status line and headers to STDERR and content + to STDOUT so that './myapp /foo.html >foo.html' works sanely - Add *.* and **.* dispatch types to keep extension - Add Antiquated Perl slides in a POD document. diff --git a/lib/Web/Simple/Application.pm b/lib/Web/Simple/Application.pm index d3806df..fdf8369 100644 --- a/lib/Web/Simple/Application.pm +++ b/lib/Web/Simple/Application.pm @@ -100,7 +100,9 @@ sub _run_test_request { Plack::Test::test_psgi( $self->to_psgi_app, sub { $response = shift->($request) } ); - print $response->as_string; + print STDERR $response->status_line."\n"; + print STDERR $response->headers_as_string("\n")."\n"; + print STDOUT $response->content."\n"; } sub _run_cli {