On Fri, Mar 18, 2011 at 5:45 PM, Uri Guttman <u...@stemsystems.com> wrote:
> >>>>> "sw" == shawn wilson <ag4ve...@gmail.com> writes: > > > sw> On Fri, Mar 18, 2011 at 5:23 PM, Uri Guttman <u...@stemsystems.com> > wrote: > >> >>>>> "sw" == shawn wilson <ag4ve...@gmail.com> writes: > >> >> > >> >> so, what your saying is: > >> > sw> my $writer = sub { > sw> my $a = shift; > sw> return [ 200, [ "Content-type" => "text/plain" ], $s ]; > sw> } > >> > >> no. where is the use of $a? where is the code call that dereferences > the > >> ref? > >> > >> > > > i don't need to see the original code. my question was about your > > rewrite so you could understand it. notice i mentioned $a explicitly as > > you used it but it wasn't in the original code. so answer my questions > > in that context. you need to show you understand the code > > dereference. hint: the shift and code deref are two separate things. > > > ok, taking another crack at it (from the top this time): my $a = Streamer->new; my $app = sub { return [ 200, [ "Content-type" => "text/plain" ], $a->open_fh ]; } ... i think, but a part of me is thinking that if it were that simple, it would have written like that (bad reasoning for thinking i'm wrong, but...)