How to Install and Uninstall perl-asa Package on openSuSE Tumbleweed
Last updated: November 07,2024
1. Install "perl-asa" package
Please follow the guidelines below to install perl-asa on openSuSE Tumbleweed
$
sudo zypper refresh
Copied
$
sudo zypper install
perl-asa
Copied
2. Uninstall "perl-asa" package
This guide let you learn how to uninstall perl-asa on openSuSE Tumbleweed:
$
sudo zypper remove
perl-asa
Copied
3. Information about the perl-asa package on openSuSE Tumbleweed
Information for package perl-asa:
---------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : perl-asa
Version : 1.04-1.20
Arch : noarch
Vendor : openSUSE
Installed Size : 31.3 KiB
Installed : No
Status : not installed
Source package : perl-asa-1.04-1.20.src
Upstream URL : https://metacpan.org/release/asa
Summary : Lets your class/object say it works like something else
Description :
Perl 5 doesn't natively support Java-style interfaces, and it doesn't
support Perl 6 style roles either.
You can get both of these things in half a dozen different ways via various
CPAN modules, but they usually require that you buy into "their way" of
implementing your code.
Other have turned to "duck typing".
This is, for the most part, a fairly naive check that says "can you do this
method", under the "if it looks like a duck, and quacks like a duck, then
it must be a duck".
It assumes that if you have a '->quack' method, then they will treat you as
a duck, because doing things like adding 'Duck' to your '@ISA' array means
you are also forced to take their implementation.
There is, of course, a better way.
For better or worse, Perl's '->isa' functionality to determine if something
is or is not a particular class/object is defined as a *method*, not a
function, and so that means that as well as adding something to you '@ISA'
array, so that Perl's 'UNIVERSAL::isa' method can work with it, you are
also allowed to simply overload your own 'isa' method and answer directly
whether or not you are something.
The simplest form of the idiom looks like this.
sub isa {
return 1 if $_[1] eq 'Duck';
shift->SUPER::isa(@_);
}
This reads "Check my type as normal, but if anyone wants to know if I'm a
duck, then tell them yes".
Now, there are a few people that have argued that this is "lying" about
your class, but this argument is based on the idea that '@ISA' is somehow
more "real" than using the method directly.
It also assumes that what you advertise you implement needs to be in sync
with the method resolution for any given function. But in the best and
cleanest implementation of code, the API is orthogonal (although most often
related) to the implementation.
And although '@ISA' is about implementation *and* API, overloading 'isa' to
let you change your API is not at all bad when seen in this light.
---------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : perl-asa
Version : 1.04-1.20
Arch : noarch
Vendor : openSUSE
Installed Size : 31.3 KiB
Installed : No
Status : not installed
Source package : perl-asa-1.04-1.20.src
Upstream URL : https://metacpan.org/release/asa
Summary : Lets your class/object say it works like something else
Description :
Perl 5 doesn't natively support Java-style interfaces, and it doesn't
support Perl 6 style roles either.
You can get both of these things in half a dozen different ways via various
CPAN modules, but they usually require that you buy into "their way" of
implementing your code.
Other have turned to "duck typing".
This is, for the most part, a fairly naive check that says "can you do this
method", under the "if it looks like a duck, and quacks like a duck, then
it must be a duck".
It assumes that if you have a '->quack' method, then they will treat you as
a duck, because doing things like adding 'Duck' to your '@ISA' array means
you are also forced to take their implementation.
There is, of course, a better way.
For better or worse, Perl's '->isa' functionality to determine if something
is or is not a particular class/object is defined as a *method*, not a
function, and so that means that as well as adding something to you '@ISA'
array, so that Perl's 'UNIVERSAL::isa' method can work with it, you are
also allowed to simply overload your own 'isa' method and answer directly
whether or not you are something.
The simplest form of the idiom looks like this.
sub isa {
return 1 if $_[1] eq 'Duck';
shift->SUPER::isa(@_);
}
This reads "Check my type as normal, but if anyone wants to know if I'm a
duck, then tell them yes".
Now, there are a few people that have argued that this is "lying" about
your class, but this argument is based on the idea that '@ISA' is somehow
more "real" than using the method directly.
It also assumes that what you advertise you implement needs to be in sync
with the method resolution for any given function. But in the best and
cleanest implementation of code, the API is orthogonal (although most often
related) to the implementation.
And although '@ISA' is about implementation *and* API, overloading 'isa' to
let you change your API is not at all bad when seen in this light.