
Context::Handle - A convenient context propagation proxy thingy.

use Context::Handle qw/context_sensitive/;
sub wrapping {
my $rv = context_sensitive {
$some_thing->method(); # anything really
};
# you can do anything here
$rv->return; # returns the value in the right context
# not reached
}

This module lets you delegate to another method and return the value without caring about context propagation.
The level of support is tied to what Want does - this module tries to make all the distinctions Want can make fully supported, for example array dereference context, boolean context, etc.

Nothing is exported by default.
This is a convenience shortcut that calls new

This method invokes $code in the calling sub's context, and returns an object that saves the return value.
This instance method returns the return value container object. The only useful methods for the RV containers is value, which has a delegator anyway.
This returns the value from the rv_container
This (ab)uses Want to perform a double return.
Saying
$rv->return;
is just like
return $rv->value;
Incidientially due to the needs of the wrapping layer this module also provides an OO interface to Want, more or less ;-)
All of these methods return boolean values, with respect to the

perldoc -f split.
Robin Houston for Want and lots of help by email

Yuval Kogman <nothingmuch@woobling.org>

Copyright (c) 2006 the aforementioned authors. All rights
reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.