From: Graham Knop Date: Fri, 31 May 2013 00:56:27 +0000 (-0400) Subject: correct docs for capture_unroll X-Git-Tag: v1.003000~66 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a4aa214892c52c232854a477f2f2115ef70bfa1;p=gitmo%2FMoo.git correct docs for capture_unroll --- diff --git a/lib/Sub/Quote.pm b/lib/Sub/Quote.pm index 3fafde6..4a9478e 100644 --- a/lib/Sub/Quote.pm +++ b/lib/Sub/Quote.pm @@ -196,7 +196,7 @@ version for convenience. =head2 inlinify - my $prelude = capture_unroll { + my $prelude = capture_unroll '$captures', { '$x' => 1, '$y' => 2, }; @@ -213,14 +213,17 @@ arguments. =head2 capture_unroll - my $prelude = capture_unroll { + my $prelude = capture_unroll '$captures', { '$x' => 1, '$y' => 2, - }; + }, 4; + +Arguments: $from, \%captures, $indent Generates a snippet of code which is suitable to be used as a prelude for -L. The keys are the names of the variables and the values are (duh) -the values. Note that references work as values. +L. C<$from> is a string will be used as a hashref in the resulting +code. The keys of C<%captures> are the names of the variables and the values +are ignored. C<$indent> is the number of spaces to indent the result by. =head1 CAVEATS