r41709 - in /branches/upstream/libcommon-sense-perl: ./ current/ current/COPYING current/Changes current/MANIFEST current/META.yml current/Makefile.PL current/README current/sense.pm current/t/ current/t/00_load.t
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Wed Aug 12 01:31:18 UTC 2009
Author: ryan52-guest
Date: Wed Aug 12 01:31:12 2009
New Revision: 41709
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41709
Log:
[svn-inject] Installing original source of libcommon-sense-perl
Added:
branches/upstream/libcommon-sense-perl/
branches/upstream/libcommon-sense-perl/current/
branches/upstream/libcommon-sense-perl/current/COPYING
branches/upstream/libcommon-sense-perl/current/Changes
branches/upstream/libcommon-sense-perl/current/MANIFEST
branches/upstream/libcommon-sense-perl/current/META.yml
branches/upstream/libcommon-sense-perl/current/Makefile.PL
branches/upstream/libcommon-sense-perl/current/README
branches/upstream/libcommon-sense-perl/current/sense.pm
branches/upstream/libcommon-sense-perl/current/t/
branches/upstream/libcommon-sense-perl/current/t/00_load.t
Added: branches/upstream/libcommon-sense-perl/current/COPYING
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/COPYING?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/COPYING (added)
+++ branches/upstream/libcommon-sense-perl/current/COPYING Wed Aug 12 01:31:12 2009
@@ -1,0 +1,2 @@
+This module is licensed under the same terms as perl itself.
+
Added: branches/upstream/libcommon-sense-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/Changes?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/Changes (added)
+++ branches/upstream/libcommon-sense-perl/current/Changes Wed Aug 12 01:31:12 2009
@@ -1,0 +1,13 @@
+Revision history for perl pragma common::sense.
+
+0.04 Sun Aug 2 10:29:23 CEST 2009
+ - added "what others..." section.
+ - reinforce attempt at world domination.
+
+0.03 Thu Jul 9 20:16:33 CEST 2009
+ - first public release, written on the Piratenstammtisch
+ (http://wiki.piratenpartei.de/Stammtisch_Karlsruhe).
+
+0.01 Thu Jul 9 17:48:00 CEST 2009
+ - original version; cloned from Convert::Scalar.
+
Added: branches/upstream/libcommon-sense-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/MANIFEST?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/MANIFEST (added)
+++ branches/upstream/libcommon-sense-perl/current/MANIFEST Wed Aug 12 01:31:12 2009
@@ -1,0 +1,8 @@
+README
+Changes
+MANIFEST
+COPYING
+Makefile.PL
+sense.pm
+t/00_load.t
+META.yml Module meta-data (added by MakeMaker)
Added: branches/upstream/libcommon-sense-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/META.yml?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/META.yml (added)
+++ branches/upstream/libcommon-sense-perl/current/META.yml Wed Aug 12 01:31:12 2009
@@ -1,0 +1,26 @@
+{
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "meta-spec" : {
+ "version" : 1.4,
+ "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
+ },
+ "generated_by" : "ExtUtils::MakeMaker version 6.50",
+ "distribution_type" : "module",
+ "version" : "0.04",
+ "name" : "common-sense",
+ "author" : [],
+ "license" : "unknown",
+ "build_requires" : {
+ "ExtUtils::MakeMaker" : 0
+ },
+ "requires" : {},
+ "abstract" : null,
+ "configure_requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+}
Added: branches/upstream/libcommon-sense-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/Makefile.PL?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/Makefile.PL (added)
+++ branches/upstream/libcommon-sense-perl/current/Makefile.PL Wed Aug 12 01:31:12 2009
@@ -1,0 +1,12 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ dist => {
+ PREOP => 'pod2text sense.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
+ COMPRESS => 'gzip -9v',
+ SUFFIX => '.gz',
+ },
+ NAME => "common::sense",
+ VERSION_FROM => "sense.pm",
+);
+
Added: branches/upstream/libcommon-sense-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/README?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/README (added)
+++ branches/upstream/libcommon-sense-perl/current/README Wed Aug 12 01:31:12 2009
@@ -1,0 +1,145 @@
+NAME
+ common::sense - save a tree AND a kitten, use common::sense!
+
+SYNOPSIS
+ use common::sense;
+
+ # roughly the same as, with much lower memory usage:
+ #
+ # use strict qw(vars subs);
+ # use feature qw(say state switch);
+ # no warnings;
+
+DESCRIPTION
+ This module implements some sane defaults for Perl programs, as defined
+ by two typical (or not so typical - use your common sense) specimens of
+ Perl coders.
+
+ no warnings
+ The dreaded warnings. Even worse, the horribly dreaded "-w" switch.
+ Even though we don't care if other people use warnings (and
+ certainly there are useful ones), a lot of warnings simply go
+ against the spirit of Perl, most prominently, the warnings related
+ to "undef". There is nothing wrong with "undef": it has well-defined
+ semantics, it is useful, and spitting out warnings you never asked
+ for is just evil.
+
+ So every module needs "no warnings" to avoid somebody accidentally
+ using "-w" and forcing his bad standards on our code. No will do.
+
+ Funnily enough, perllexwarn explicitly mentions "-w" (and not in a
+ favourable way), but standard utilities, such as prove, or MakeMaker
+ when running "make test" enable them blindly.
+
+ use strict qw(subs vars)
+ Using "use strict" is definitely common sense, but "use strict
+ 'refs'" definitely overshoots it's usefulness. After almost two
+ decades of Perl hacking, we decided that it does more harm than
+ being useful. Specifically, constructs like these:
+
+ @{ $var->[0] }
+
+ Must be written like this (or similarly), when "use strict 'refs'"
+ is in scope, and $var can legally be "undef":
+
+ @{ $var->[0] || [] }
+
+ This is annoying, and doesn't shield against obvious mistakes such
+ as using "", so one would even have to write:
+
+ @{ defined $var->[0] ? $var->[0] : [] }
+
+ ... which nobody with a bit of common sense would consider writing.
+ Curiously enough, sometimes, perl is not so strict, as this works
+ even with "use strict" in scope:
+
+ for (@{ $var->[0] }) { ...
+
+ If that isnt hipocrasy! And all that from a mere program!
+
+ use feature qw(say state given)
+ We found it annoying that we always have to enable extra features.
+ If something breaks because it didn't anticipate future changes, so
+ be it. 5.10 broke almost all our XS modules and nobody cared either
+ - and few modules that are no longer maintained work with newer
+ versions of Perl, regardless of use feature.
+
+ If your code isn't alive, it's dead, jim.
+
+ much less memory
+ Just using all those pragmas together waste <blink>*776
+ kilobytes*</blink> of precious memory in my perl, for *every single
+ perl process using our code*, which on our machines, is a lot. In
+ comparison, this module only uses *four* kilobytes (I even had to
+ write it out so it looks like more) of memory on the same platform.
+
+ The money/time/effort/electricity invested in these gigabytes
+ (probably petabytes globally!) of wasted memory could easily save 42
+ trees, and a kitten!
+
+THERE IS NO 'no common::sense'!!!! !!!! !!
+ This module doesn't offer an unimport. First of all, it wastes even more
+ memory, second, and more importantly, who with even a bit of common
+ sense would want no common sense?
+
+STABILITY AND FUTURE VERSIONS
+ Future versions might change just about everything in this module. We
+ might test our modules and upload new ones working with newer versions
+ of this module, and leave you standing in the rain because we didn't
+ tell you.
+
+ Most likely, we will pick a few useful warnings, instead of just
+ disabling all of them. And maybe we will load some nifty modules that
+ try to emulate "say" or so with perls older than 5.10 (this module, of
+ course, should work with older perl versions - supporting 5.8 for
+ example is just common sense at this time. Maybe not in the future, but
+ of course you can trust our common sense).
+
+WHAT OTHER PEOPLE HAVE TO SAY ABOUT THIS MODULE
+ Pista Palo
+
+ "Something in short supply these days..."
+
+ Steffen Schwigon
+
+ "This module is quite for sure *not* just a repetition of all the other
+ 'use strict, use warnings'-approaches, and it's also not the opposite.
+ [...] And for its chosen middle-way it's also not the worst name ever.
+ And everything is documented."
+
+ BKB
+
+ "[Deleted - thanks to Steffen Schwigon for pointing out this review was
+ in error.]"
+
+ Somni
+
+ "the arrogance of the guy"
+ "I swear he tacked somenoe else's name onto the module
+ just so he could use the royal 'we' in the documentation"
+
+ dngor
+
+ "Heh. '"<elmex at ta-sa.org>"' The quotes are semantic
+ distancing from that e-mail address."
+
+ Jerad Pierce
+
+ "Awful name (not a proper pragma), and the SYNOPSIS doesn't tell you
+ anything either. Nor is it clear what features have to do with "common
+ sense" or discipline."
+
+ acme
+
+ "THERE IS NO 'no common::sense'!!!! !!!! !!"
+
+ crab
+
+ "i wonder how it would be if joerg schilling wrote perl modules."
+
+AUTHOR
+ Marc Lehmann <schmorp at schmorp.de>
+ http://home.schmorp.de/
+
+ Robin Redeker, "<elmex at ta-sa.org>".
+
Added: branches/upstream/libcommon-sense-perl/current/sense.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/sense.pm?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/sense.pm (added)
+++ branches/upstream/libcommon-sense-perl/current/sense.pm Wed Aug 12 01:31:12 2009
@@ -1,0 +1,184 @@
+=head1 NAME
+
+common::sense - save a tree AND a kitten, use common::sense!
+
+=head1 SYNOPSIS
+
+ use common::sense;
+
+ # roughly the same as, with much lower memory usage:
+ #
+ # use strict qw(vars subs);
+ # use feature qw(say state switch);
+ # no warnings;
+
+=head1 DESCRIPTION
+
+This module implements some sane defaults for Perl programs, as defined by
+two typical (or not so typical - use your common sense) specimens of
+Perl coders.
+
+=over 4
+
+=item no warnings
+
+The dreaded warnings. Even worse, the horribly dreaded C<-w> switch. Even
+though we don't care if other people use warnings (and certainly there are
+useful ones), a lot of warnings simply go against the spirit of Perl, most
+prominently, the warnings related to C<undef>. There is nothing wrong with
+C<undef>: it has well-defined semantics, it is useful, and spitting out
+warnings you never asked for is just evil.
+
+So every module needs C<no warnings> to avoid somebody accidentally using
+C<-w> and forcing his bad standards on our code. No will do.
+
+Funnily enough, L<perllexwarn> explicitly mentions C<-w> (and not in a
+favourable way), but standard utilities, such as L<prove>, or MakeMaker
+when running C<make test> enable them blindly.
+
+=item use strict qw(subs vars)
+
+Using C<use strict> is definitely common sense, but C<use strict
+'refs'> definitely overshoots it's usefulness. After almost two
+decades of Perl hacking, we decided that it does more harm than being
+useful. Specifically, constructs like these:
+
+ @{ $var->[0] }
+
+Must be written like this (or similarly), when C<use strict 'refs'> is in
+scope, and C<$var> can legally be C<undef>:
+
+ @{ $var->[0] || [] }
+
+This is annoying, and doesn't shield against obvious mistakes such as
+using C<"">, so one would even have to write:
+
+ @{ defined $var->[0] ? $var->[0] : [] }
+
+... which nobody with a bit of common sense would consider
+writing. Curiously enough, sometimes, perl is not so strict, as this works
+even with C<use strict> in scope:
+
+ for (@{ $var->[0] }) { ...
+
+If that isnt hipocrasy! And all that from a mere program!
+
+=item use feature qw(say state given)
+
+We found it annoying that we always have to enable extra features. If
+something breaks because it didn't anticipate future changes, so be
+it. 5.10 broke almost all our XS modules and nobody cared either - and few
+modules that are no longer maintained work with newer versions of Perl,
+regardless of use feature.
+
+If your code isn't alive, it's dead, jim.
+
+=item much less memory
+
+Just using all those pragmas together waste <blink>I<< B<776> kilobytes
+>></blink> of precious memory in my perl, for I<every single perl process
+using our code>, which on our machines, is a lot. In comparison, this
+module only uses I<< B<four> >> kilobytes (I even had to write it out so
+it looks like more) of memory on the same platform.
+
+The money/time/effort/electricity invested in these gigabytes (probably
+petabytes globally!) of wasted memory could easily save 42 trees, and a
+kitten!
+
+=cut
+
+package common::sense;
+
+our $VERSION = '0.04';
+
+sub import {
+ # no warnings
+ ${^WARNING_BITS} ^= ${^WARNING_BITS};
+
+ # use strict vars subs
+ $^H |= 0x00000600;
+
+ # use feature
+ $^H{feature_switch} =
+ $^H{feature_say} =
+ $^H{feature_state} = 1;
+}
+
+1;
+
+=back
+
+=head1 THERE IS NO 'no common::sense'!!!! !!!! !!
+
+This module doesn't offer an unimport. First of all, it wastes even more
+memory, second, and more importantly, who with even a bit of common sense
+would want no common sense?
+
+=head1 STABILITY AND FUTURE VERSIONS
+
+Future versions might change just about everything in this module. We
+might test our modules and upload new ones working with newer versions of
+this module, and leave you standing in the rain because we didn't tell
+you.
+
+Most likely, we will pick a few useful warnings, instead of just disabling
+all of them. And maybe we will load some nifty modules that try to emulate
+C<say> or so with perls older than 5.10 (this module, of course, should
+work with older perl versions - supporting 5.8 for example is just common
+sense at this time. Maybe not in the future, but of course you can trust
+our common sense).
+
+
+=head1 WHAT OTHER PEOPLE HAVE TO SAY ABOUT THIS MODULE
+
+Pista Palo
+
+ "Something in short supply these days..."
+
+Steffen Schwigon
+
+ "This module is quite for sure *not* just a repetition of all the other
+ 'use strict, use warnings'-approaches, and it's also not the opposite.
+ [...] And for its chosen middle-way it's also not the worst name ever.
+ And everything is documented."
+
+BKB
+
+ "[Deleted - thanks to Steffen Schwigon for pointing out this review was
+ in error.]"
+
+Somni
+
+ "the arrogance of the guy"
+ "I swear he tacked somenoe else's name onto the module
+ just so he could use the royal 'we' in the documentation"
+
+dngor
+
+ "Heh. '"<elmex at ta-sa.org>"' The quotes are semantic
+ distancing from that e-mail address."
+
+Jerad Pierce
+
+ "Awful name (not a proper pragma), and the SYNOPSIS doesn't tell you
+ anything either. Nor is it clear what features have to do with "common
+ sense" or discipline."
+
+acme
+
+ "THERE IS NO 'no common::sense'!!!! !!!! !!"
+
+crab
+
+ "i wonder how it would be if joerg schilling wrote perl modules."
+
+=head1 AUTHOR
+
+ Marc Lehmann <schmorp at schmorp.de>
+ http://home.schmorp.de/
+
+ Robin Redeker, "<elmex at ta-sa.org>".
+
+
+=cut
+
Added: branches/upstream/libcommon-sense-perl/current/t/00_load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcommon-sense-perl/current/t/00_load.t?rev=41709&op=file
==============================================================================
--- branches/upstream/libcommon-sense-perl/current/t/00_load.t (added)
+++ branches/upstream/libcommon-sense-perl/current/t/00_load.t Wed Aug 12 01:31:12 2009
@@ -1,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded}
+use common::sense;
+our $loaded = 1;
+print "ok 1\n";
More information about the Pkg-perl-cvs-commits
mailing list