Package: perl-PerlX-Maybe (1.202-bp160.1.12)
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.
Package information
- Homepage
- [https://metacpan.org/release/PerlX-Maybe]
- License
- Artistic-1.0 OR GPL-1.0-or-later
- Downstream package maintainer
- Unknown: not reported in the indexed source
- Source package
- [perl-PerlX-Maybe]
- Software project
- [libperlx-maybe-perl]
Versions and downloads for perl-PerlX-Maybe
| Version / release | Architecture / repository | Package size | Installed size | Files | Publisher repository artifact |
|---|---|---|---|---|---|
| 1.202-bp160.1.12leap-16.0 / oss | noarchopenSUSE Leap 16.0 · OSS · multi-architecture | 28 KiB | 50 KiB | list of files | perl-PerlX-Maybe-1.202-bp160.1.12.noarch.rpm |
About these downloads
Each row is recorded package-index metadata for one version, architecture, suite, and repository. Names, URLs, and sizes are source-reported; a link is a potentially mutable retrieval location, not an OpenFactory redistribution claim or proof that OpenFactory retained the artifact bytes.
Dependencies and recommendations for perl-PerlX-Maybe
dep: perl(:MODULE_COMPAT_5.42.0)
Package not available
rec: perl(Exporter::Tiny)
Package not available
rec: perl(PerlX::Maybe::XS)
Package not available
Package file paths (15)
Paths come from the repository package-file index for the observed builds. They describe archive/package associations, not every file that will exist on a running system after maintainer scripts, alternatives, generated state, diversions, or installation choices.
- /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/Changes
- /usr/share/doc/packages/perl-PerlX-Maybe/COPYRIGHT
- /usr/share/doc/packages/perl-PerlX-Maybe/CREDITS
- /usr/share/doc/packages/perl-PerlX-Maybe/doap.ttl
- /usr/share/doc/packages/perl-PerlX-Maybe/README
- /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
Field source: openSUSE Leap 16.0 OSS
