Hello community, here is the log from the commit of package perl-Symbol-Util for openSUSE:Factory checked in at 2013-06-05 13:07:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Symbol-Util (Old) and /work/SRC/openSUSE:Factory/.perl-Symbol-Util.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Symbol-Util" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Symbol-Util/perl-Symbol-Util.changes 2012-01-04 07:28:35.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Symbol-Util.new/perl-Symbol-Util.changes 2013-06-05 13:07:29.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Jun 4 18:35:03 UTC 2013 - [email protected] + +- updated to 0.0203 + Fixes: + + * Compiles cleanly with Perl 5.14: defined(%hash) and defined(@array) are + deprecated. Fixes: RT#75763. + * Mixor changes in POD. + +------------------------------------------------------------------- Old: ---- Symbol-Util-0.0202.tar.gz New: ---- Symbol-Util-0.0203.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Symbol-Util.spec ++++++ --- /var/tmp/diff_new_pack.elnxpr/_old 2013-06-05 13:07:29.000000000 +0200 +++ /var/tmp/diff_new_pack.elnxpr/_new 2013-06-05 13:07:29.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Symbol-Util # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,8 +15,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: perl-Symbol-Util -Version: 0.0202 +Version: 0.0203 Release: 0 %define cpan_name Symbol-Util Summary: Additional utils for Perl symbols manipulation @@ -44,6 +45,15 @@ This module provides a set of additional functions useful for Perl symbols manipulation. +All Perl symbols from the same package are organized as a stash. Each +symbol (glob) contains one or more of following slots: 'SCALAR', 'ARRAY', +'HASH', 'CODE', 'IO', 'FORMAT'. These slots are also accessible as standard +variables or bare words. + +The Perl symbols table is directly accessible with typeglob prefix but it +can be difficult to read and problematic if strict mode is used. Also the +access to stash, glob and one of its slot have different syntax notation. + 'stash' and 'fetch_glob' functions gets stash or glob without need to use 'no strict 'refs''. @@ -53,6 +63,8 @@ 'delete_sub' removes the symbol from class API. This symbol won't be available as an object method. +'export_glob' function exports a glob to the target package. + 'export_package' works like the Exporter manpage module and allows to export symbols from one package to other. @@ -74,6 +86,6 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc Changes eg LICENSE README xt +%doc Changes examples LICENSE README xt %changelog ++++++ Symbol-Util-0.0202.tar.gz -> Symbol-Util-0.0203.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/Build.PL new/Symbol-Util-0.0203/Build.PL --- old/Symbol-Util-0.0202/Build.PL 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/Build.PL 2012-03-15 22:19:27.000000000 +0100 @@ -15,7 +15,7 @@ module_name => $module, license => 'perl', requires => { - 'perl' => 5.006, + 'perl' => 5.006, }, optional => { }, @@ -29,13 +29,13 @@ recursive_test_files => 1, add_to_cleanup => [ '*.bak', '*.gz', '*.tgz', '*.ppd', '*.ppmx', '*.deb', '*.bat', - 'Makefile', 'pm_to_blib', 'cover_db', 'xt/Debian_CPANTS.txt', + 'Makefile', 'pm_to_blib', 'cover_db', 'Debian_CPANTS.txt', "$dist-*", ], meta_merge => { resources => { bugtracker => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=$dist", - repository => "http://dexter-cpan.googlecode.com/svn/$dist", + repository => "http://github.com/dex4er/perl-$dist", }, }, ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/Changes new/Symbol-Util-0.0203/Changes --- old/Symbol-Util-0.0202/Changes 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/Changes 2012-03-15 22:19:27.000000000 +0100 @@ -1,4 +1,13 @@ ------------------------------------------------------------------------ +0.0203 | Piotr Roszatycki <[email protected]> | 2012-03-14 + +Fixes: + +* Compiles cleanly with Perl 5.14: defined(%hash) and defined(@array) are + deprecated. Fixes: RT#75763. +* Mixor changes in POD. + +------------------------------------------------------------------------ 0.0202 | Piotr Roszatycki <[email protected]> | 2009-11-29 Fixes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/LICENSE new/Symbol-Util-0.0203/LICENSE --- old/Symbol-Util-0.0202/LICENSE 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/LICENSE 2012-03-15 22:19:27.000000000 +0100 @@ -1,9 +1,9 @@ -This software is copyright (c) 2009 by Piotr Roszatycki <[email protected]>. +This software is copyright (c) 2012 by Piotr Roszatycki <[email protected]>. This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. +the same terms as the Perl 5 programming language system itself. -Terms of Perl itself +Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any @@ -12,21 +12,22 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2009 by Piotr Roszatycki <[email protected]>. +This software is Copyright (c) 2012 by Piotr Roszatycki <[email protected]>. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -207,9 +208,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it @@ -235,8 +236,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + Also add information on how to contact you by electronic and paper mail. @@ -270,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2009 by Piotr Roszatycki <[email protected]>. +This software is Copyright (c) 2012 by Piotr Roszatycki <[email protected]>. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/MANIFEST new/Symbol-Util-0.0203/MANIFEST --- old/Symbol-Util-0.0202/MANIFEST 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/MANIFEST 2012-03-15 22:19:27.000000000 +0100 @@ -1,12 +1,9 @@ Build.PL Changes -eg/delete_glob.pl +examples/delete_glob.pl lib/Symbol/Util.pm -LICENSE -Makefile.PL -MANIFEST +MANIFEST This list of files MANIFEST.SKIP -META.yml README t/10use.t t/20fetch_glob.t @@ -31,5 +28,9 @@ xt/pod_spellrc xt/pod_syntax.t xt/signature.t +Makefile.PL +LICENSE +META.yml +META.json SIGNATURE Added here by Module::Build SIGNATURE Added here by Module::Build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/MANIFEST.SKIP new/Symbol-Util-0.0203/MANIFEST.SKIP --- old/Symbol-Util-0.0202/MANIFEST.SKIP 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/MANIFEST.SKIP 2012-03-15 22:19:27.000000000 +0100 @@ -6,6 +6,8 @@ \B\.cvsignore$ \B\.git\b \B\.gitignore$ +\B\.bzr\b +\B\.bzrignore$ # Avoid Makemaker generated and utility files. \bMakefile$ @@ -18,6 +20,7 @@ \bBuild$ \bBuild.bat$ \b_build +\bDist.SH$ # Avoid Devel::Cover generated files \bcover_db @@ -55,3 +58,5 @@ # Avoid distdir \d+\.\d+\b +^MYMETA.yml$ +^MYMETA\.json$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/META.json new/Symbol-Util-0.0203/META.json --- old/Symbol-Util-0.0202/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/Symbol-Util-0.0203/META.json 2012-03-15 22:19:27.000000000 +0100 @@ -0,0 +1,42 @@ +{ + "abstract" : "Additional utils for Perl symbols manipulation", + "author" : [ + "Piotr Roszatycki <[email protected]>" + ], + "dynamic_config" : 1, + "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.112150", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Symbol-Util", + "prereqs" : { + "runtime" : { + "requires" : { + "perl" : "5.006" + } + } + }, + "provides" : { + "Symbol::Util" : { + "file" : "lib/Symbol/Util.pm", + "version" : "0.0203" + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Symbol-Util" + }, + "license" : [ + "http://dev.perl.org/licenses/" + ], + "repository" : { + "url" : "http://github.com/dex4er/perl-Symbol-Util" + } + }, + "version" : "0.0203" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/META.yml new/Symbol-Util-0.0203/META.yml --- old/Symbol-Util-0.0202/META.yml 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/META.yml 2012-03-15 22:19:27.000000000 +0100 @@ -1,21 +1,23 @@ --- -name: Symbol-Util -version: 0.0202 +abstract: 'Additional utils for Perl symbols manipulation' author: - 'Piotr Roszatycki <[email protected]>' -abstract: Additional utils for Perl symbols manipulation +build_requires: {} +dynamic_config: 1 +generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.112150' license: perl -resources: - bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Symbol-Util - license: http://dev.perl.org/licenses/ - repository: http://dexter-cpan.googlecode.com/svn/Symbol-Util -requires: - perl: 5.006 -provides: - Symbol::Util: - file: lib/Symbol/Util.pm - version: 0.0202 -generated_by: Module::Build version 0.35 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 +name: Symbol-Util +provides: + Symbol::Util: + file: lib/Symbol/Util.pm + version: 0.0203 +requires: + perl: 5.006 +resources: + bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Symbol-Util + license: http://dev.perl.org/licenses/ + repository: http://github.com/dex4er/perl-Symbol-Util +version: 0.0203 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/Makefile.PL new/Symbol-Util-0.0203/Makefile.PL --- old/Symbol-Util-0.0202/Makefile.PL 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/Makefile.PL 2012-03-15 22:19:27.000000000 +0100 @@ -1,14 +1,16 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.35 +# Note: this file was auto-generated by Module::Build::Compat version 0.3800 require 5.006; use ExtUtils::MakeMaker; WriteMakefile ( - 'TESTS' => 't/*.t', - 'PL_FILES' => {}, - 'INSTALLDIRS' => 'site', - 'NAME' => 'Symbol::Util', - 'EXE_FILES' => [], - 'VERSION_FROM' => 'lib/Symbol/Util.pm', - 'PREREQ_PM' => {} - ) + 'test' => { + 'TESTS' => 't/*.t' + }, + 'PL_FILES' => {}, + 'INSTALLDIRS' => 'site', + 'NAME' => 'Symbol::Util', + 'EXE_FILES' => [], + 'VERSION_FROM' => 'lib/Symbol/Util.pm', + 'PREREQ_PM' => {} +) ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/README new/Symbol-Util-0.0203/README --- old/Symbol-Util-0.0202/README 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/README 2012-03-15 22:19:27.000000000 +0100 @@ -27,6 +27,16 @@ This module provides a set of additional functions useful for Perl symbols manipulation. + All Perl symbols from the same package are organized as a stash. Each + symbol (glob) contains one or more of following slots: `SCALAR', + `ARRAY', `HASH', `CODE', `IO', `FORMAT'. These slots are also accessible + as standard variables or bare words. + + The Perl symbols table is directly accessible with typeglob prefix but + it can be difficult to read and problematic if strict mode is used. Also + the access to stash, glob and one of its slot have different syntax + notation. + `stash' and `fetch_glob' functions gets stash or glob without need to use `no strict 'refs''. @@ -36,6 +46,8 @@ `delete_sub' removes the symbol from class API. This symbol won't be available as an object method. + `export_glob' function exports a glob to the target package. + `export_package' works like Exporter module and allows to export symbols from one package to other. @@ -44,11 +56,11 @@ AUTHOR Piotr Roszatycki <[email protected]> -COPYRIGHT - Copyright (C) 2009 by Piotr Roszatycki <[email protected]>. +LICENSE + Copyright (c) 2009, 2012 Piotr Roszatycki <[email protected]>. - This program is free software; you can redistribute it and/or modify it - under the same terms as Perl itself. + This is free software; you can redistribute it and/or modify it under + the same terms as perl itself. - See http://www.perl.com/perl/misc/Artistic.html + See http://dev.perl.org/licenses/artistic.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/SIGNATURE new/Symbol-Util-0.0203/SIGNATURE --- old/Symbol-Util-0.0202/SIGNATURE 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/SIGNATURE 2012-03-15 22:19:27.000000000 +0100 @@ -1,5 +1,5 @@ This file contains message digests of all files listed in MANIFEST, -signed via the Module::Signature module, version 0.55. +signed via the Module::Signature module, version 0.68. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: @@ -14,24 +14,25 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 70014a1d49cb3f1c1e0c96a315e263565533b412 Build.PL -SHA1 380b90b9b38bfff87141aac2d8bdb5495965af10 Changes -SHA1 74b1c398020b9c1e8849b7982751cb70ecc5de8d LICENSE -SHA1 5ad50078d3c4fa68b839ceae7f4a66240d4bf81e MANIFEST -SHA1 a1dbf257177f9f76372ac111f127bc34f4f3fb24 MANIFEST.SKIP -SHA1 7172b441ab9d1dfe9165bf44eb64cbc23323168b META.yml -SHA1 feb7360a7f67feafaee3c8071aac6e264ea5ccd6 Makefile.PL -SHA1 63472e6bd3cd3daf82613b6587792d2794a1e1a2 README -SHA1 01bd53ec0aa49f117e2efcec0eba6a6e79dddbcd eg/delete_glob.pl -SHA1 80cdd1c6091591d1210abc80f050dd166f819bdf lib/Symbol/Util.pm +SHA1 64187a35467f5d3caaf4aa9de38bc4c5b3b8e8c8 Build.PL +SHA1 78b87ef61b3fbaacd72da19dd4122c85e65f5b47 Changes +SHA1 39d4369e877ca8afd2c5736d89d21b67976f2d07 LICENSE +SHA1 3e63773211bc5f3e1e98a6a662257bad74bfd66b MANIFEST +SHA1 c3a34543c726b0d9c39e90592d1db5ae07b6f1b3 MANIFEST.SKIP +SHA1 f5bab1c0fdf4a688b6459fae03f7835dda160afc META.json +SHA1 2ee4aefd21c3fb220d0948a560dd02170ac5e8de META.yml +SHA1 da87b7fe0e3592609e071cdd7805a69df847b5fb Makefile.PL +SHA1 a71689014a5facf86c62e5486869d84bfe8450d7 README +SHA1 01bd53ec0aa49f117e2efcec0eba6a6e79dddbcd examples/delete_glob.pl +SHA1 6d8505ceb14cf4e88bd3a3711bf00dbcd3d6d806 lib/Symbol/Util.pm SHA1 b97b512bb745d3cfba183fb7bb602d202ab0c64a t/10use.t SHA1 e8a68b237414b6f66c6417c53049c9fed82566ac t/20fetch_glob.t SHA1 f3e33e6dff6c02eea6ff5198900733cf934fdd32 t/30stash.t -SHA1 60e49295af476060150d0e5a945bc9bc61c4cafd t/40delete_glob.t +SHA1 33d9c4ea87d7ff432af36f3465cbd6dcccb2c624 t/40delete_glob.t SHA1 f74093b7a32ea26d53a92bab4b74a23d9e3297b6 t/50delete_sub.t SHA1 69e58b80300689ac1824567abaea4f79cb7d249f t/60list_glob_slots.t SHA1 6a584065dc0cbc1bacb8b45ebbc88ad6b178504e t/70export_glob.t -SHA1 a7631e884b8db6cc6c2052a2ad21be731b7bdcc8 t/80export_package.t +SHA1 f380dd4a98a1fd0f310641ba2990dfa924411641 t/80export_package.t SHA1 abec3fa7149e59f9f36680c5a49dfbbebd9d6ecc t/test.pl SHA1 90353a99ac0f719b6f3e58029804d8556cedc2ab xt/check_changes.t SHA1 a56d0c02b6c992e04a77d13a6ee89504bd718572 xt/consistent_version_numbers.t @@ -41,16 +42,16 @@ SHA1 44147122d52fef90ab3a2c65ebba4f89342174f8 xt/kwalitee.t SHA1 6e7f9dde7560793bcb40acc41561e07d163ad6d1 xt/minimumversion.t SHA1 e8daa0c73cfc304c240fad2d2c2b1b628175a89d xt/perlcritic.t -SHA1 68635a0f2d9305949e2cfefcf8404bd222d6554a xt/perlcriticrc +SHA1 ab8306fa77897b01df453d1353b5acfb02cce80b xt/perlcriticrc SHA1 775b3ac02805b6d703614f42608732fb43af2a41 xt/pod_coverage.t SHA1 bef7d46eb5cbc3e67956d4e823ec199f41ab9268 xt/pod_spell.t -SHA1 0b189c3cebce85f885ae917c8c7d85ea5332ca1c xt/pod_spellrc +SHA1 676c85e06d6e0845e3990a9976d33ef84a883a4b xt/pod_spellrc SHA1 2c579b58def8daec94f41b628ac81c256faaa2b1 xt/pod_syntax.t SHA1 a38994922fda6d64e2ee75198fadc464a221fea9 xt/signature.t -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) +Version: GnuPG v1.4.11 (GNU/Linux) -iEYEARECAAYFAksSZFwACgkQhMHHe8CxClsqygCgtpgC4x/gqV0+Qt2L01VqPt5r -zUIAoKJjtR9aglwhBLxUttlUcwtyjQqZ -=+bEz +iEYEARECAAYFAk9iXN8ACgkQhMHHe8CxClv5CQCgsu+wcbUavM2WIM6kvUk1RK2S +MJkAn1dEQS1FLHtC59HTF5tPz2ckvC6k +=J2Be -----END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/eg/delete_glob.pl new/Symbol-Util-0.0203/eg/delete_glob.pl --- old/Symbol-Util-0.0202/eg/delete_glob.pl 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/eg/delete_glob.pl 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -#!/usr/bin/perl - -use lib 'lib', '../lib'; - -use Symbol::Util ':all'; - -$\ = "\n"; - -print '=== Simple undef destroys all slots'; -eval { - our $FOO = 42; - sub FOO { 666 }; - - print "*** Before:"; - print $FOO; - print FOO(); - - undef *FOO; - - print "*** After:"; - print $FOO; - print FOO(); -}; - -print '=== delete_glob() can remove just CODE slot'; -eval { - our $BAR = 42; - sub BAR { 666 }; - - print "*** Before:"; - print $BAR; - print BAR(); - - delete_glob("BAR", "CODE"); - - print "*** After:"; - print $BAR; - print BAR(); -}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/examples/delete_glob.pl new/Symbol-Util-0.0203/examples/delete_glob.pl --- old/Symbol-Util-0.0202/examples/delete_glob.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Symbol-Util-0.0203/examples/delete_glob.pl 2012-03-15 22:19:27.000000000 +0100 @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +use lib 'lib', '../lib'; + +use Symbol::Util ':all'; + +$\ = "\n"; + +print '=== Simple undef destroys all slots'; +eval { + our $FOO = 42; + sub FOO { 666 }; + + print "*** Before:"; + print $FOO; + print FOO(); + + undef *FOO; + + print "*** After:"; + print $FOO; + print FOO(); +}; + +print '=== delete_glob() can remove just CODE slot'; +eval { + our $BAR = 42; + sub BAR { 666 }; + + print "*** Before:"; + print $BAR; + print BAR(); + + delete_glob("BAR", "CODE"); + + print "*** After:"; + print $BAR; + print BAR(); +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/lib/Symbol/Util.pm new/Symbol-Util-0.0203/lib/Symbol/Util.pm --- old/Symbol-Util-0.0202/lib/Symbol/Util.pm 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/lib/Symbol/Util.pm 2012-03-15 22:19:27.000000000 +0100 @@ -34,6 +34,15 @@ This module provides a set of additional functions useful for Perl symbols manipulation. +All Perl symbols from the same package are organized as a stash. Each symbol +(glob) contains one or more of following slots: C<SCALAR>, C<ARRAY>, C<HASH>, +C<CODE>, C<IO>, C<FORMAT>. These slots are also accessible as standard +variables or bare words. + +The Perl symbols table is directly accessible with typeglob prefix but it can +be difficult to read and problematic if strict mode is used. Also the access +to stash, glob and one of its slot have different syntax notation. + C<stash> and C<fetch_glob> functions gets stash or glob without need to use C<no strict 'refs'>. @@ -43,6 +52,8 @@ C<delete_sub> removes the symbol from class API. This symbol won't be available as an object method. +C<export_glob> function exports a glob to the target package. + C<export_package> works like L<Exporter> module and allows to export symbols from one package to other. @@ -58,17 +69,14 @@ use strict; use warnings; -our $VERSION = '0.0202'; +our $VERSION = '0.0203'; # Exported symbols $EXPORTED{$target}{$package}{$name}{$slot} = 1 my %EXPORTED; -## no critic qw(ProhibitSubroutinePrototypes) -## no critic qw(RequireArgUnpacking) - -=head1 IMPORTS +=head1 USAGE By default, the class does not export its symbols. @@ -118,19 +126,18 @@ =item stash( I<name> : Str ) : HashRef -Returns a refernce to the stash for the specified name. If the stash does not -already exists it will be created. The name of the stash does not include the -C<::> at the end. It is safe to use this function with C<use strict 'refs'>. - -This function is taken from Kurila, a dialect of Perl. +Returns a reference to the stash for the specified name. If the stash does +not already exist then it will be created. The name of the stash does not +include the C<::> at the end. It is safe to use this function with +C<use strict 'refs'>. - print join "\n", keys %{ Symbol::stash("main") }; + print join "\n", keys %{ stash("main") }; =cut sub stash ($) { no strict 'refs'; - return \%{ *{ $_[0] . '::' } }; + return *{ $_[0] . '::' }{HASH}; }; @@ -138,16 +145,14 @@ =item fetch_glob( I<name> : Str, I<slot> : Str ) : Ref -Returns a reference to the glob for the specified symbol name. If the -symbol does not already exists it will be created. If the symbol name is -unqualified it will be looked up in the calling package. It is safe to use -this function with C<use strict 'refs'>. - -If I<slot> argument is defined and this slot has defined value, reference to -its value is returned. The I<slot> argument can be one of the following -strings: C<SCALAR>, C<ARRAY>, C<HASH>, C<CODE>, C<IO>, C<FORMAT>). - -This function is taken from Kurila, a dialect of Perl. +Returns a reference to the glob for the specified symbol name. If the symbol +does not already exist then it will be created. If the symbol name is +unqualified then it will be looked up in the calling package. It is safe to +use this function with C<use strict 'refs'>. + +If the I<slot> argument is defined and this slot contains defined value, +reference to this value is returned. The I<slot> argument can be one of the +following strings: C<SCALAR>, C<ARRAY>, C<HASH>, C<CODE>, C<IO>, C<FORMAT>). my $caller = caller; *{ fetch_glob("${caller}::foo") } = sub { "this is foo" }; @@ -173,13 +178,16 @@ =item list_glob_slots( I<name> ) : Maybe[Array] -Returns a list of slot names for glob with specified name which have defined -value. If the glob is undefined, the C<undef> value is returned. If the glob -is defined and has no defined slots, the empty list is returned. +Returns a list of slot names for glob with specified I<name> which contain +defined value. If the glob is undefined, the C<undef> value is returned. If +the glob is defined and has no defined slots, the empty list is returned. The C<SCALAR> slot is used only if it contains defined value. - print join ",", list_glob_slots("foo"); + my $foo = 42; + my @foo = (1, 2); + sub foo { 1; }; + print join ",", list_glob_slots("foo"); # SCALAR,ARRAY,CODE =cut @@ -302,8 +310,10 @@ =item delete_sub( I<name> : Str ) : Maybe[GlobRef] Deletes (or hides) the specified subroutine name from class API. It means -that this subroutine will be no longer available as the class method. The -purpose of this function is the same as L<namespace::clean> pragma has. +that this subroutine will be no longer available as a class method. The +purpose of this function is the same as L<namespace::clean> pragma has: it +cleans a package's namespace from unwanted subroutines. Function doesn't +delete other slots than C<CODE> slot of the glob. Function returns the glob reference if there are any other slots still defined than <CODE> slot. @@ -318,11 +328,11 @@ sub area { my ($self, $r) = @_; - return PI * $r ** 2 + return PI * $r ** 2; } print My::Class->area(2); # prints 12.5663706 - print My::Class->PI; # can't locate object method + print My::Class->PI; # Can't locate object method =cut @@ -410,15 +420,15 @@ =cut sub export_package ($$@) { - my $target = shift; - my $package = shift; - my $spec = ref $_[0] eq 'HASH' ? shift : { + my ($target, $package, @args) = @_; + + my $spec = ref $args[0] eq 'HASH' ? shift @args : { EXPORT => fetch_glob("${package}::EXPORT", "ARRAY"), OK => fetch_glob("${package}::EXPORT_OK", "ARRAY"), TAGS => fetch_glob("${package}::EXPORT_TAGS", "HASH"), }; - my @names = @_; + my @names = @args; # support: use Package 3.14 qw(); return 1 if @names == 1 and $names[0] eq ''; @@ -508,7 +518,7 @@ }; -=item unexport_package( I<target>, I<package> ) : Bool +=item unexport_package( I<target> : Str, I<package> : Str ) : Bool Deletes symbols previously exported from I<package> to I<target> with C<export_package> function. If the symbol was C<CODE> reference it is deleted @@ -519,8 +529,10 @@ via class API as an object method. require YAML; - export_package(__PACKAGE__, "YAML", "dump"); + export_package(__PACKAGE__, "YAML", "Dump"); unexport_package(__PACKAGE__, "YAML"); + print Dump @INC; # OK + __PACKAGE__->Dump; # Can't locate object method This function can be used as a helper in C<unimport> method. @@ -599,10 +611,10 @@ C<fetch_glob> returns C<undef> value if C<SCALAR> slot contains C<undef> value. -C<delete_glob> deletes C<SCALAR> slot if it exists and contains C<undef> -value. +C<delete_glob> and C<delete_sub> delete C<SCALAR> slot if it exists and +contains C<undef> value. -C<delete_glob> always deletes C<FORMAT> slot. +C<delete_glob> and C<delete_sub> always delete C<FORMAT> slot. If you find the bug or want to implement new features, please report it at L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Symbol-Util> @@ -613,11 +625,11 @@ Piotr Roszatycki <[email protected]> -=head1 COPYRIGHT +=head1 LICENSE -Copyright (C) 2009 by Piotr Roszatycki <[email protected]>. +Copyright (c) 2009, 2012 Piotr Roszatycki <[email protected]>. -This program is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. +This is free software; you can redistribute it and/or modify it under +the same terms as perl itself. -See L<http://www.perl.com/perl/misc/Artistic.html> +See L<http://dev.perl.org/licenses/artistic.html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/t/40delete_glob.t new/Symbol-Util-0.0203/t/40delete_glob.t --- old/Symbol-Util-0.0202/t/40delete_glob.t 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/t/40delete_glob.t 2012-03-15 22:19:27.000000000 +0100 @@ -39,22 +39,22 @@ ok( defined delete_glob("Symbol::Util::Test40::FOO", "ARRAY", "HASH"), 'delete_glob("Symbol::Util::Test40::FOO", "ARRAY", "HASH")' ); ok( ! defined $Symbol::Util::Test40::FOO, '$Symbol::Util::Test40::FOO is ok [3]' ); -ok( ! defined @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [3]' ); -ok( ! defined %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [3]' ); +ok( ! @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [3]' ); +ok( ! %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [3]' ); is( eval { &Symbol::Util::Test40::FOO }, 'code', '&Symbol::Util::Test40::FOO is ok [3]' ); ok( fileno Symbol::Util::Test40::FOO, '*Symbol::Util::Test40::FOO{IO} is ok [3]' ); ok( defined delete_glob("Symbol::Util::Test40::FOO", "CODE"), 'delete_glob("Symbol::Util::Test40::FOO", "CODE")' ); ok( ! defined $Symbol::Util::Test40::FOO, '$Symbol::Util::Test40::FOO is ok [4]' ); -ok( ! defined @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [4]' ); -ok( ! defined %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [4]' ); +ok( ! @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [4]' ); +ok( ! %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [4]' ); ok( ! eval { &Symbol::Util::Test40::FOO }, '&Symbol::Util::Test40::FOO is ok [4]' ); ok( fileno Symbol::Util::Test40::FOO, '*Symbol::Util::Test40::FOO{IO} is ok [4]' ); ok( defined delete_glob("Symbol::Util::Test40::FOO", "IO"), 'delete_glob("Symbol::Util::Test40::FOO", "IO")' ); ok( ! defined $Symbol::Util::Test40::FOO, '$Symbol::Util::Test40::FOO is ok [5]' ); -ok( ! defined @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [5]' ); -ok( ! defined %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [5]' ); +ok( ! @Symbol::Util::Test40::FOO, '@Symbol::Util::Test40::FOO is ok [5]' ); +ok( ! %Symbol::Util::Test40::FOO, '%Symbol::Util::Test40::FOO is ok [5]' ); ok( ! eval { &Symbol::Util::Test40::FOO }, '&Symbol::Util::Test40::FOO is ok [5]' ); ok( ! fileno Symbol::Util::Test40::FOO, '*Symbol::Util::Test40::FOO{IO} is ok [5]' ); @@ -96,8 +96,8 @@ ok( ! defined delete_glob("Symbol::Util::Test40::BAR"), 'delete_glob("Symbol::Util::Test40::BAR") [1]' ); ok( ! defined $Symbol::Util::Test40::BAR, '$Symbol::Util::Test40::BAR is ok [4]' ); -ok( ! defined @Symbol::Util::Test40::BAR, '@Symbol::Util::Test40::BAR is ok [4]' ); -ok( ! defined %Symbol::Util::Test40::BAR, '%Symbol::Util::Test40::BAR is ok [4]' ); +ok( ! @Symbol::Util::Test40::BAR, '@Symbol::Util::Test40::BAR is ok [4]' ); +ok( ! %Symbol::Util::Test40::BAR, '%Symbol::Util::Test40::BAR is ok [4]' ); ok( ! eval { &Symbol::Util::Test40::BAR }, '&Symbol::Util::Test40::BAR is ok [4]' ); ok( ! fileno Symbol::Util::Test40::BAR, '*Symbol::Util::Test40::BAR{IO} is ok [4]' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/t/80export_package.t new/Symbol-Util-0.0203/t/80export_package.t --- old/Symbol-Util-0.0202/t/80export_package.t 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/t/80export_package.t 2012-03-15 22:19:27.000000000 +0100 @@ -210,8 +210,8 @@ unexport_package("Symbol::Util::Test80::Target9", "Symbol::Util::Test80::Source1"); pass( 'unexport_package("Symbol::Util::Test80::Target9", "Symbol::Util::Test80::Source1")' ); -ok( ! defined @Symbol::Util::Test80::Target9::BAZ, '@Symbol::Util::Test80::Target9::BAZ is ok [2]' ); -ok( ! defined %Symbol::Util::Test80::Target9::BAZ, '%Symbol::Util::Test80::Target9::BAZ is ok [2]' ); +ok( ! @Symbol::Util::Test80::Target9::BAZ, '@Symbol::Util::Test80::Target9::BAZ is ok [2]' ); +ok( ! %Symbol::Util::Test80::Target9::BAZ, '%Symbol::Util::Test80::Target9::BAZ is ok [2]' ); ok( ! defined *Symbol::Util::Test80::Target9::BAZ{IO}, '*Symbol::Util::Test80::Target9::BAZ{IO} is ok [2]' ); { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/xt/perlcriticrc new/Symbol-Util-0.0203/xt/perlcriticrc --- old/Symbol-Util-0.0202/xt/perlcriticrc 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/xt/perlcriticrc 2012-03-15 22:19:27.000000000 +0100 @@ -20,6 +20,11 @@ [Subroutines::ProhibitExcessComplexity] max_mccabe = 40 +[-Subroutines::ProhibitSubroutinePrototypes] + +[Subroutines::RequireArgUnpacking] +short_subroutine_statements = 2 + [TestingAndDebugging::ProhibitNoStrict] allow = vars subs refs @@ -28,3 +33,4 @@ [TestingAndDebugging::ProhibitProlongedStrictureOverride] statements = 12 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Symbol-Util-0.0202/xt/pod_spellrc new/Symbol-Util-0.0203/xt/pod_spellrc --- old/Symbol-Util-0.0202/xt/pod_spellrc 2009-11-29 13:09:00.000000000 +0100 +++ new/Symbol-Util-0.0203/xt/pod_spellrc 2012-03-15 22:19:27.000000000 +0100 @@ -1,9 +1,7 @@ API GlobRef -Kurila +namespace Piotr Roszatycki Str -constains -refernce utils -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
