Upstream software project

perl-Contextual-Return

Create context-sensitive return values

About perl-Contextual-Return

Create context-sensitive return values

This project links 1 native package record across 1 recorded operating-system release. Compare the retained versions and architectures below, then open the package for your own release.

These are catalog observations, not a guarantee of installation, compatibility, or upstream support.

Project pictures and package coverage

openSUSE Leap 15.6: 1 package records. Catalog coverage diagram, not an application screenshot.perl-Contextual-Return: recorded package coverageopenSUSE Leap 15.61 records
OpenFactory diagram of linked package records. It is not an application screenshot.

Project identity

Project
perl-Contextual-Return
Publisher
Not authoritatively mapped
Native package records
1
Operating systems
opensuse-leap-15-6
License expression
Artistic-1.0 or GPL-1.0+
Source repository
Not reported

Source-reported description

The fullest retained description is shown with its source. Distribution packaging descriptions may include downstream details.

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) = @_; my %server_data = _ascertain_server_status($server_ID); 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!}; } } That works okay, but the code could certainly be more readable. In its simplest usage, this module makes that code more readable by providing three subroutines--'LIST()', 'SCALAR()', 'VOID()'--that are true only when the current subroutine is called in the corresponding context: use Contextual::Return; sub get_server_status { my ($server_ID) = @_; my %server_data = _ascertain_server_status($server_ID); if (LIST) { return @server_data{ qw(name uptime load users) } } if (SCALAR) { return $server_data{load} } if (VOID) { print "$server_data{load}\n" } else { croak q{Bad context! No biscuit!} } }

Description source

Packages by operating system

Compare recorded versions, then open a package for dependency, file, checksum, and repository evidence. Version strings are distribution-specific, not a ranking of newer software.

openSUSE Leap 15.6

  1. Package perl-Contextual-Return

    leap-15.6 (openSUSE Leap 15.6) (Development/Libraries/Perl): Create context-sensitive return values

    0.004014-bp156.3.1: noarch

    Source: perl-Contextual-Return

Project resources and further reading

Mapping provenance

Only source-backed identity signals create public cross-OS links. A reviewer can later approve or dispute an inferred relationship without rewriting native package history.

No field-level source record is published yet.