On 11-03-18 06:41 PM, shawn wilson wrote:
an argument to what sub?
(it's obvious that i've missed the boat on this concept)
my $writer = shift->(
[ 200, [ "Content-type" => "text/plain" ], $s ]
);
The array @_ contains a sub ref as its first argument. It is this sub
that gets [ 200, [ "Content-type" => "text/plain" ], $s ] as its argument.
It can be rewritten as:
my sub_ref = shift @_;
my $writer = $sub_ref->(
[ 200, [ "Content-type" => "text/plain" ], $s ]
);
--
Just my 0.00000002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/