--- http.pm,old 2007-11-09 14:30:02.000000000 -0800 +++ http.pm 2007-11-09 14:46:24.000000000 -0800 @@ -166,7 +166,20 @@ }); my $content_ref = $request->content_ref; + + ## -- dboonstra + ## if content_ref is a CODE ref this is a runtime + ## error , but HTTP::Message only permits scalar refs + ## so this is not an issue $content_ref = $$content_ref if ref($$content_ref); + ## but if we want to get content from a CODE ref + ## it wont work as documented. + ## By the docs we may use $arg as content + ## and $arg may be a CODE ref, so lets do this + if ( length($$content_ref) == 0 ) + { + $content_ref = ref $arg ? $arg : \$arg; + } my $chunked; my $has_content;