Source: libcontextual-return-perl
Section: perl
Priority: optional
Build-Depends: debhelper (>= 4.0.2), libmodule-build-perl
Build-Depends-Indep: perl (>= 5.8.0-7)
Maintainer: David Moreno Garza <damog@cerdita.damog.net>
Standards-Version: 3.6.1

Package: libcontextual-return-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, 
Description:  Create context-senstive return values
 Usually, when you need to create a subroutine that returns different values in
 different contexts (list, scalar, or void), you write something like:
 .
 sub get_server_status {
 my ($server_ID) = @_;
 .
 # Acquire server data somehow...
 my %server_data = _ascertain_server_status($server_ID);
 .
 # Return different components of that data,
 # depending on call context...
 if (wantarray()) {
 return @server_data{ qw(name uptime load users) };
 }
 if (defined wantarray()) {
 return $server_data{load};
 }
 if (!defined wantarray()) {
 carp 'Useless use of get_server_status() in void context';
 return;
 }
 else {
 croak q{Bad context! No biscuit!};
 }
 }
 .
 This description was automagically extracted from the module by dh-make-perl.
