| Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
| Name: perl-PerlX-Maybe | Distribution: openSUSE Tumbleweed |
| Version: 1.202 | Vendor: openSUSE |
| Release: 1.12 | Build date: Tue Mar 15 04:07:45 2022 |
| Group: Unspecified | Build host: reproducible |
| Size: 51357 | Source RPM: perl-PerlX-Maybe-1.202-1.12.src.rpm |
| Packager: http://bugs.opensuse.org | |
| Url: https://metacpan.org/release/PerlX-Maybe | |
| Summary: Return a pair only if they are both defined | |
Moose classes (and some other classes) distinguish between an attribute
being unset and the attribute being set to undef. Supplying a constructor
arguments like this:
my $bob = Person->new(
name => $name,
age => $age,
);
Will result in the 'name' and 'age' attributes possibly being set to undef
(if the corresponding '$name' and '$age' variables are not defined), which
may violate the Person class' type constraints.
(Note: if you are the _author_ of the class in question, you can solve this
using MooseX::UndefTolerant. However, some of us are stuck using
non-UndefTolerant classes written by third parties.)
To ensure that the Person constructor does not try to set a name or age at
all when they are undefined, ugly looking code like this is often used:
my $bob = Person->new(
defined $name ? (name => $name) : (),
defined $age ? (age => $age) : (),
);
or:
my $bob = Person->new(
(name => $name) x!!(defined $name),
(age => $age) x!!(defined $age),
);
A slightly more elegant solution is the 'maybe' function.
Artistic-1.0 OR GPL-1.0-or-later
* Tue Mar 15 2022 Tina Müller <timueller+perl@suse.de>
- updated to 1.202
see /usr/share/doc/packages/perl-PerlX-Maybe/Changes
1.202 2022-03-14 Pi Day
- Fix code example.
Daniel Böhmer++
* Thu Dec 06 2018 Stephan Kulow <coolo@suse.com>
- updated to 1.201
see /usr/share/doc/packages/perl-PerlX-Maybe/Changes
1.201 2018-11-25
- Improve documentation for `provided_deref`.
Michael Jemmeson++
* Thu Nov 08 2018 Stephan Kulow <coolo@suse.com>
- updated to 1.200
see /usr/share/doc/packages/perl-PerlX-Maybe/Changes
1.200 2018-10-10 Big new features time!
[ Packaging ]
- Package using newer version of Dist::Inkt.
- Require Scalar::Util.
[ Other ]
- Add `use` line to SYNOPSIS.
Ivan Baidakou++
- Added: Add `provided_deref` and `provided_deref_with_maybe` functions.
Theo van Hoesel++
- Progressively load exporters, choosing Exporter.pm or Exporter::Tiny as
needed.
* Mon Apr 13 2015 coolo@suse.com
- updated to 1.001
see /usr/share/doc/packages/perl-PerlX-Maybe/Changes
* Tue Dec 10 2013 coolo@suse.com
- initial package 1.000
* created by cpanspec 1.78.07
/usr/lib/perl5/vendor_perl/5.42.0/PerlX /usr/lib/perl5/vendor_perl/5.42.0/PerlX/Maybe.pm /usr/lib/perl5/vendor_perl/5.42.0/Syntax /usr/lib/perl5/vendor_perl/5.42.0/Syntax/Feature /usr/lib/perl5/vendor_perl/5.42.0/Syntax/Feature/Maybe.pm /usr/share/doc/packages/perl-PerlX-Maybe /usr/share/doc/packages/perl-PerlX-Maybe/COPYRIGHT /usr/share/doc/packages/perl-PerlX-Maybe/CREDITS /usr/share/doc/packages/perl-PerlX-Maybe/Changes /usr/share/doc/packages/perl-PerlX-Maybe/README /usr/share/doc/packages/perl-PerlX-Maybe/doap.ttl /usr/share/licenses/perl-PerlX-Maybe /usr/share/licenses/perl-PerlX-Maybe/LICENSE /usr/share/man/man3/PerlX::Maybe.3pm.gz /usr/share/man/man3/Syntax::Feature::Maybe.3pm.gz
Generated by rpm2html 1.8.1
Fabrice Bellet, Thu Oct 23 22:37:43 2025