i ran across a peace of interesting code:

my $writer = shift->(
 [ 200, [ "Content-type" => "text/plain" ], $s ]
);

so, if i understand this correctly, this would be the same as
my $writer = sub {
 my $a = shift;
 my $thing = sub {
  my $subthing = $writer->{ $a };
  return  [ 200, [ "Content-type" => "text/plain" ], $subthing ];
 }
}

... or something like that. what is happening there, or how should i think
about it? it seems like shift is returning $writer->[ $array ] maybe? i
think using shift as a method like that is messing me up.

Reply via email to