diff Lib/IMPL/Web/Application/Response.pm @ 65:2840c4c85db8

Application configuration improvements Documentation
author wizard
date Tue, 16 Mar 2010 17:36:13 +0300
parents 76b878ad6596
children 9f5795a10939
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Response.pm	Mon Mar 15 17:45:13 2010 +0300
+++ b/Lib/IMPL/Web/Application/Response.pm	Tue Mar 16 17:36:13 2010 +0300
@@ -37,7 +37,16 @@
 	
 	$this->query(CGI->new($this->query() | {})) unless $this->query;
 	
-	$this->streamOut(*STDOUT) unless $this->streamOut;
+	if (lc $this->streamOut eq 'memory') {
+		my $dummy = '';
+		open my $hout, '>:encoding(utf8)', \$dummy or die new IMPL::Exception("Failed to create memory stream",$!);
+		$this->streamOut($hout);
+	} elsif (not $this->streamOut) {
+		$this->streamOut(*STDOUT);	
+	} else {
+		die new IMPL::InvalidArgumentException("Invalid parameter value",$this->streamOut);
+	}
+	
 	$this->buffered(1) unless defined $this->buffered;
 	binmode $this->streamOut, ":encoding(".$this->charset.")";
 }