On Tue, 22 Mar 2011 13:41:59 -0700, Randal L. Schwartz wrote:

>>>>>> "Peter" == Peter Scott <pe...@psdt.com> writes:
> 
>>> my $s = Streamer->new;
>>> my $app = sub {
>>> return sub {
>>> $s->open_fh;
>>> my $writer = shift->(
>>> [ 200, [ "Content-type" => "text/plain" ], $s ] );
>>> };
>>> };
> 
> Peter> As it stands, this doesn't make sense because nothing happens to
> $writer; Peter> so why create it?
> 
> I presume you're objecting to the explicit $writer.  Certainly, the
> value of $writer is also the return value of the inner subroutine, so
> that *is* something that could be noted:

Right, the superfluous naming of $writer leads to a lot of head-
scratching.  Best guess (if this is an accurate post of the code), that 
there was originally some debugging/logging code in there before a 
"return $writer" that got taken out.  Although I supposed that the paste 
was incomplete.  Either way, a giant red herring.

-- 
Peter Scott
http://www.perlmedic.com/     http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/courses/perl3/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to