X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FScope%2FContext.pm;h=85fd57365e7eeacf839251b86a28d9f7075673ca;hb=e8b777e025ed69b121b659618d6d6451541cee5a;hp=9f887b3442975f8097b7513aeaf6b87bbfc01e65;hpb=4aa20fdf3f0a11fcd29276c295234da92f36176b;p=perl%2Fmodules%2FScope-Context.git diff --git a/lib/Scope/Context.pm b/lib/Scope/Context.pm index 9f887b3..85fd573 100644 --- a/lib/Scope/Context.pm +++ b/lib/Scope/Context.pm @@ -8,7 +8,7 @@ use warnings; use Carp (); use Scalar::Util (); -use Scope::Upper 0.18 (); +use Scope::Upper 0.21 (); =head1 NAME @@ -425,6 +425,24 @@ sub unwind { Scope::Upper::unwind(@_ => $self->cxt); } +=head2 C + + $cxt->yield(@values); + +Immediately returns the scalars listed in C<@values> from the topic context, whatever it may be (except a substitution eval context). + +See L for details. + +=cut + +sub yield { + my $self = shift; + + $self->assert_valid; + + Scope::Upper::yield(@_ => $self->cxt); +} + =head2 C my @ret = $cxt->uplevel($code, @args); @@ -448,7 +466,7 @@ sub uplevel { L (core module since perl 5), L (since 5.7.3). -L 0.18. +L 0.21. =head1 SEE ALSO @@ -475,7 +493,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2011 Vincent Pit, all rights reserved. +Copyright 2011,2012 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.