Projects
openEuler:Mainline
perl-Exporter
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:perl-Exporter.spec
Changed
@@ -1,6 +1,6 @@ Name: perl-Exporter -Version: 5.74 -Release: 2 +Version: 5.77 +Release: 1 Summary: Implements default import method for modules License: GPL+ or Artistic URL: https://metacpan.org/release/Exporter @@ -53,6 +53,9 @@ %{_mandir}/man3/* %changelog +* Tue Jul 18 2023 leeffo <liweiganga@uniontech.com> - 5.77-1 +- upgrade to version 5.77 + * Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 5.74-2 - DESC: delete -S git from %autosetup, and delete BuildRequires git
View file
_service:tar_scm:Exporter-5.74.tar.gz/Changes -> _service:tar_scm:Exporter-5.77.tar.gz/Changes
Changed
@@ -1,5 +1,9 @@ Revision history for Perl extension Exporter. +5.77 Mon January 23 2023 + - Document non-inheriting as default mechanism + - Make Exporter strict and warnings compliant + 5.74 Mon January 20 2020 - Fix leading spaces in Exporter error message - Switch to github actions for pre-release actions
View file
_service:tar_scm:Exporter-5.74.tar.gz/META.json -> _service:tar_scm:Exporter-5.77.tar.gz/META.json
Changed
@@ -4,7 +4,7 @@ "unknown" , "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010", "license" : "perl_5" , @@ -53,6 +53,6 @@ }, "x_MailingList" : "http://lists.perl.org/list/perl5-porters.html" }, - "version" : "5.74", - "x_serialization_backend" : "JSON::PP version 4.02" + "version" : "5.77", + "x_serialization_backend" : "JSON::PP version 4.07" }
View file
_service:tar_scm:Exporter-5.74.tar.gz/META.yml -> _service:tar_scm:Exporter-5.77.tar.gz/META.yml
Changed
@@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -27,5 +27,5 @@ bugtracker: https://github.com/Perl/perl5/issues license: http://dev.perl.org/licenses/ repository: https://github.com/Perl/perl5/tree/blead/dist/Exporter -version: '5.74' +version: '5.77' x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
View file
_service:tar_scm:Exporter-5.74.tar.gz/lib/Exporter.pm -> _service:tar_scm:Exporter-5.77.tar.gz/lib/Exporter.pm
Changed
@@ -1,16 +1,13 @@ package Exporter; -require 5.006; - -# Be lean. -#use strict; -#no strict 'refs'; +use strict; +no strict 'refs'; our $Debug = 0; our $ExportLevel = 0; our $Verbose ||= 0; -our $VERSION = '5.74'; -our (%Cache); +our $VERSION = '5.77'; +our %Cache; sub as_heavy { require Exporter::Heavy; @@ -105,14 +102,20 @@ In module F<YourModule.pm>: package YourModule; + use Exporter 'import'; + our @EXPORT_OK = qw(munge frobnicate); # symbols to export on request + +or + + package YourModule; require Exporter; - our @ISA = qw(Exporter); + our @ISA = qw(Exporter); # inherit all of Exporter's methods our @EXPORT_OK = qw(munge frobnicate); # symbols to export on request or package YourModule; - use Exporter 'import'; # gives you Exporter's import() method directly + use parent 'Exporter'; # inherit all of Exporter's methods our @EXPORT_OK = qw(munge frobnicate); # symbols to export on request In other files which wish to use C<YourModule>: @@ -146,8 +149,8 @@ The symbols must be given by full name with the exception that the ampersand in front of a function is optional, e.g. - our @EXPORT = qw(afunc $scalar @array); # afunc is a function - our @EXPORT_OK = qw(&bfunc %hash *typeglob); # explicit prefix on &bfunc + our @EXPORT = qw(afunc $scalar @array); # afunc is a function + our @EXPORT_OK = qw(&bfunc %hash *typeglob); # explicit prefix on &bfunc If you are only exporting function names it is recommended to omit the ampersand, as the implementation is faster this way. @@ -312,7 +315,7 @@ By including Exporter in your C<@ISA> you inherit an Exporter's import() method but you also inherit several other helper methods which you probably don't -want. To avoid this you can do: +want and complicate the inheritance tree. To avoid this you can do: package YourModule; use Exporter qw(import); @@ -476,8 +479,8 @@ modules, which are affected by the time the relevant constructions are executed. -The ideal (but a bit ugly) way to never have to think -about that is to use C<BEGIN> blocks. So the first part +The ideal way to never have to think about that is to use +C<BEGIN> blocks and the simple import method. So the first part of the L</SYNOPSIS> code could be rewritten as: package YourModule; @@ -485,16 +488,27 @@ use strict; use warnings; - our (@ISA, @EXPORT_OK); + use Exporter 'import'; + BEGIN { + our @EXPORT_OK = qw(munge frobnicate); # symbols to export on request + } + +Or if you need to inherit from Exporter: + + package YourModule; + + use strict; + use warnings; + BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(munge frobnicate); # symbols to export on request + require Exporter; + our @ISA = qw(Exporter); # inherit all of Exporter's methods + our @EXPORT_OK = qw(munge frobnicate); # symbols to export on request } The C<BEGIN> will assure that the loading of F<Exporter.pm> and the assignments to C<@ISA> and C<@EXPORT_OK> happen -immediately, leaving no room for something to get awry +immediately like C<use>, leaving no room for something to get awry or just plain wrong. With respect to loading C<Exporter> and inheriting, there @@ -505,7 +519,7 @@ use parent qw(Exporter); Any of these statements are nice replacements for -C<BEGIN { require Exporter; @ISA = qw(Exporter); }> +C<BEGIN { require Exporter; our @ISA = qw(Exporter); }> with the same compile-time effect. The basic difference is that C<base> code interacts with declared C<fields> while C<parent> is a streamlined version of the older
View file
_service:tar_scm:Exporter-5.74.tar.gz/lib/Exporter/Heavy.pm -> _service:tar_scm:Exporter-5.77.tar.gz/lib/Exporter/Heavy.pm
Changed
@@ -4,7 +4,7 @@ no strict 'refs'; # On one line so MakeMaker will see it. -require Exporter; our $VERSION = $Exporter::VERSION; +our $VERSION = '5.77'; =head1 NAME
View file
_service:tar_scm:Exporter-5.74.tar.gz/t/Exporter.t -> _service:tar_scm:Exporter-5.77.tar.gz/t/Exporter.t
Changed
@@ -1,5 +1,8 @@ #!perl -w +use strict; +use warnings; + # Can't use Test::Simple/More, they depend on Exporter. my $test; sub ok ($;$) { @@ -18,39 +21,36 @@ BEGIN { $test = 1; - print "1..33\n"; + print "1..34\n"; require Exporter; ok( 1, 'Exporter compiled' ); } -BEGIN { - # Methods which Exporter says it implements. - @Exporter_Methods = qw(import +our @Exporter_Methods = qw(import export_to_level require_version export_fail ); -} package Testing; require Exporter; -@ISA = qw(Exporter); +our @ISA = qw(Exporter); # Make sure Testing can do everything its supposed to. foreach my $meth (@::Exporter_Methods) { ::ok( Testing->can($meth), "subclass can $meth()" ); } -%EXPORT_TAGS = ( +our %EXPORT_TAGS = ( This => qw(stuff %left), That => qw(Above the @wailing), tray => qw(Fasten $seatbelt), ); -@EXPORT = qw(lifejacket is); -@EXPORT_OK = qw(under &your $seat); -$VERSION = '1.05'; +our @EXPORT = qw(lifejacket is); +our @EXPORT_OK = qw(under &your $seat); +our $VERSION = '1.05'; ::ok( Testing->require_version(1.05), 'require_version()' ); eval { Testing->require_version(1.11); 1 }; @@ -168,15 +168,15 @@ package More::Testing; -@ISA = qw(Exporter); -$VERSION = 0; +our @ISA = qw(Exporter); +our $VERSION = 0; eval { More::Testing->require_version(0); 1 }; ::ok(!$@, 'require_version(0) and $VERSION = 0'); package Yet::More::Testing; -@ISA = qw(Exporter); -$VERSION = 0; +our @ISA = qw(Exporter); +our $VERSION = 0; eval { Yet::More::Testing->require_version(10); 1 }; ::ok($@ !~ /\(undef\)/, 'require_version(10) and $VERSION = 0'); @@ -185,8 +185,8 @@ BEGIN { local $SIG{__WARN__} = sub { $warnings = join '', @_ }; package Testing::Unused::Vars; - @ISA = qw(Exporter); - @EXPORT = qw(this $TODO that); + our @ISA = qw(Exporter); + our @EXPORT = qw(this $TODO that); package Foo; Testing::Unused::Vars->import; @@ -196,8 +196,8 @@ print "# $warnings\n"; package Moving::Target; -@ISA = qw(Exporter); -@EXPORT_OK = qw (foo); +our @ISA = qw(Exporter); +our @EXPORT_OK = qw (foo); sub foo {"This is foo"}; sub bar {"This is bar"}; @@ -215,12 +215,11 @@ ::ok (bar() eq "This is bar", "imported bar after EXPORT_OK changed"); package The::Import; - use Exporter 'import'; ::ok(\&import == \&Exporter::import, "imported the import routine"); -@EXPORT = qw( wibble ); +our @EXPORT = qw( wibble ); sub wibble {return "wobble"}; package Use::The::Import; @@ -238,8 +237,8 @@ package Exporter::for::Tied::_; -@ISA = 'Exporter'; -@EXPORT = 'foo'; +our @ISA = 'Exporter'; +our @EXPORT = 'foo'; package Tied::_; @@ -253,3 +252,8 @@ } } ::ok(1, 'import with tied $_'); + +# this should be loaded, but make sure +require Exporter::Heavy; +::ok(Exporter->VERSION eq Exporter::Heavy->VERSION, + 'Exporter and Exporter::Heavy have matching versions');
View file
_service:tar_scm:Exporter-5.74.tar.gz/t/warn.t -> _service:tar_scm:Exporter-5.77.tar.gz/t/warn.t
Changed
@@ -25,7 +25,8 @@ package Foo; Exporter->import("import"); -@EXPORT_OK = "bar"; +our @EXPORT_OK = qw/bar/; + package main;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2