Name : perl-subroutines
| |
Version : 0.001
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.1.1
| Date : 2023-01-27 18:12:24
|
Group : Development/Libraries/Perl
| Source RPM : perl-subroutines-0.001-lp154.1.1.src.rpm
|
Size : 0.02 MB
| |
Packager : https://www_suse_com/
| |
Summary : Use subroutines from another module
|
Description :
This pragma declares routines in your module that are copied from another module.
package Your::Module; use subroutines \'Another::Module\';
is equivalent to this pseudo-code:
package Your::Module; BEGIN { require Another::Module; for my $name (all_subroutines_in(\"Another::Module\")) { *{\"Your::Module::$name\"} = \\&{\"Another::Module::$name\"}; } }
This is a form of code reuse when you cannot do:
package Your::Module; use parent \'Another::Module\';
because the original subroutines do not expect to be called as methods, and/or when your subroutines are not called as methods.
Another alternative is to declare \'Your::Module\' as an alias of \'Another::Module\', e.g. using alias::module.
package Your::Module; use alias::module \'Another::Module\';
but this copies everythng, not just subroutines.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-S/15.4/noarch |