r70055 - in /branches/upstream/libdevel-argnames-perl: ./ current/ current/MANIFEST current/MANIFEST.SKIP current/META.yml current/Makefile.PL current/SIGNATURE current/lib/ current/lib/Devel/ current/lib/Devel/ArgNames.pm current/t/ current/t/001_basic.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Mon Feb 28 10:59:26 UTC 2011


Author: periapt-guest
Date: Mon Feb 28 10:59:16 2011
New Revision: 70055

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70055
Log:
[svn-inject] Installing original source of libdevel-argnames-perl (0.03)

Added:
    branches/upstream/libdevel-argnames-perl/
    branches/upstream/libdevel-argnames-perl/current/
    branches/upstream/libdevel-argnames-perl/current/MANIFEST
    branches/upstream/libdevel-argnames-perl/current/MANIFEST.SKIP
    branches/upstream/libdevel-argnames-perl/current/META.yml
    branches/upstream/libdevel-argnames-perl/current/Makefile.PL
    branches/upstream/libdevel-argnames-perl/current/SIGNATURE
    branches/upstream/libdevel-argnames-perl/current/lib/
    branches/upstream/libdevel-argnames-perl/current/lib/Devel/
    branches/upstream/libdevel-argnames-perl/current/lib/Devel/ArgNames.pm
    branches/upstream/libdevel-argnames-perl/current/t/
    branches/upstream/libdevel-argnames-perl/current/t/001_basic.t

Added: branches/upstream/libdevel-argnames-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/MANIFEST?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/MANIFEST (added)
+++ branches/upstream/libdevel-argnames-perl/current/MANIFEST Mon Feb 28 10:59:16 2011
@@ -1,0 +1,7 @@
+lib/Devel/ArgNames.pm
+Makefile.PL
+MANIFEST			This list of files
+MANIFEST.SKIP
+t/001_basic.t
+META.yml                                 Module meta-data (added by MakeMaker)
+SIGNATURE                                Public-key signature (added by MakeMaker)

Added: branches/upstream/libdevel-argnames-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/MANIFEST.SKIP?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libdevel-argnames-perl/current/MANIFEST.SKIP Mon Feb 28 10:59:16 2011
@@ -1,0 +1,38 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+\bSCCS\b
+,v$
+\B\.svn\b
+\b_darcs\b
+
+# Avoid Makemaker generated and utility files.
+\bMANIFEST\.bak
+\bMakefile$
+\bblib/
+\bMakeMaker-\d
+\bpm_to_blib\.ts$
+\bpm_to_blib$
+\bblibdirs\.ts$         # 6.18 through 6.25 generated this
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build/
+
+# Avoid temp and backup files.
+~$
+\.old$
+\#$
+\b\.#
+\.bak$
+
+# Avoid Devel::Cover files.
+\bcover_db\b
+
+### DEFAULT MANIFEST.SKIP ENDS HERE ####
+
+\.DS_Store$
+\.sw.$
+\.tar\.gz$
+^(\w+-)*(\w+)-\d\.\d+$
+

Added: branches/upstream/libdevel-argnames-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/META.yml?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/META.yml (added)
+++ branches/upstream/libdevel-argnames-perl/current/META.yml Mon Feb 28 10:59:16 2011
@@ -1,0 +1,14 @@
+--- #YAML:1.0
+name:                Devel-ArgNames
+version:             0.03
+abstract:            ~
+license:             ~
+author:              ~
+generated_by:        ExtUtils::MakeMaker version 6.42
+distribution_type:   module
+requires:     
+    PadWalker:                     0
+    Test::use::ok:                 0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Added: branches/upstream/libdevel-argnames-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/Makefile.PL?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/Makefile.PL (added)
+++ branches/upstream/libdevel-argnames-perl/current/Makefile.PL Mon Feb 28 10:59:16 2011
@@ -1,0 +1,18 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+	NAME         => 'Devel::ArgNames',
+	VERSION_FROM => 'lib/Devel/ArgNames.pm',
+	INSTALLDIRS  => 'site',
+	SIGN         => 1,
+	PL_FILES     => { },
+	PREREQ_PM    => {
+		PadWalker => 0,
+		'Test::use::ok' => 0,
+	},
+);
+

Added: branches/upstream/libdevel-argnames-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/SIGNATURE?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/SIGNATURE (added)
+++ branches/upstream/libdevel-argnames-perl/current/SIGNATURE Mon Feb 28 10:59:16 2011
@@ -1,0 +1,29 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.55.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+    % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity.  If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 ab8a7e5ffbf2254a99141ffd0cce6d00de8ce312 MANIFEST
+SHA1 ddb918d4e02cc06f4b9fe77adeca65403f8fdd56 MANIFEST.SKIP
+SHA1 edddf41d660a50e6acbbf309fd94bb50474437a0 META.yml
+SHA1 61124877aace6f6df4ec0a1683d830288f12fa93 Makefile.PL
+SHA1 50068c3298637a6efbfbb4b144809158f07a3b36 lib/Devel/ArgNames.pm
+SHA1 c5f09fbf33a8344db19ba1cd86777d9f82c08281 t/001_basic.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.7 (Darwin)
+
+iD8DBQFHe7V1VCwRwOvSdBgRAh0YAJ9vFkh8Oh6zKWK/dISJjuAa9zi7kwCffnhq
+ZolyJO7a8iIXtCGtK1+2deU=
+=vOQy
+-----END PGP SIGNATURE-----

Added: branches/upstream/libdevel-argnames-perl/current/lib/Devel/ArgNames.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/lib/Devel/ArgNames.pm?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/lib/Devel/ArgNames.pm (added)
+++ branches/upstream/libdevel-argnames-perl/current/lib/Devel/ArgNames.pm Mon Feb 28 10:59:16 2011
@@ -1,0 +1,102 @@
+#!/usr/bin/perl
+
+package Devel::ArgNames;
+
+use strict;
+use warnings;
+
+our $VERSION = "0.03";
+
+use base qw(Exporter);
+
+our @EXPORT_OK = our @EXPORT = qw(arg_names);
+
+use PadWalker qw(peek_my peek_our);
+
+sub arg_names (;$) {
+	my $level = shift || 2;
+	{ package DB; () = caller($level - 1) }
+	@{{ reverse %{peek_my($level)}, %{peek_our($level)} }}{\(@DB::args)};
+}
+
+__PACKAGE__
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Devel::ArgNames - Figure out the names of variables passed into subroutines.
+
+=head1 SYNOPSIS
+
+	use Devel::ArgNames;
+
+	sub foo {
+		warn "foo() called with arguments: "
+			. join(", ", map { defined() ? $_ : "<unknown>" } arg_names(@_) );
+	}
+
+	foo($bar, $gorch, $blah[4]);	
+
+=head1 DESCRIPTION
+
+When print-debugging code, you will often ind yourself going:
+
+	print "\$foo is $foo, \$bar is $bar"
+
+With this module, you can write a reusable subroutine easily:
+
+	sub my_print_vars {
+		my %vars;
+
+		@vars{arg_names()} = @_;
+
+		foreach my $var ( keys %vars ) {
+			warn "$var is $vars{$var}\n";
+		}
+	}
+
+	my_print_vars($foo, $bar);
+
+This module doesn't provide dumping facilities because there are too many to
+choose from. This is a DIY kit ;-)
+
+=head1 EXPORTS
+
+=over 4
+
+=item arg_names [ $level ]
+
+This function will return the names associated with the variables found on
+C<@_>, at the level $level. If C<$level> is not provided C<arg_names>'s
+caller's caller will be used (C<$level == 2> in that case).
+
+=back
+
+=head1 VERSION CONTROL
+
+This module is maintained using Darcs. You can get the latest version from
+L<http://nothingmuch.woobling.org/Devel-ArgNames/>, and use C<darcs send> to
+commit changes.
+
+=head1 SEE ALSO
+
+L<Data::Dumper::Simple>, L<DB>, L<Devel::Caller>, L<Devel::Caller::Perl>,
+L<PadWalker>.
+
+=head1 AUTHORS
+
+Ran Eilam
+
+Yuval Kogman E<lt>nothingmuch at woobling.orgE<gt>
+
+=head1 COPYRIGHT
+
+	Copyright (c) 2007 Yuval Kogman. All rights reserved
+	This program is free software; you can redistribute
+	it and/or modify it under the same terms as Perl itself.
+
+=cut
+

Added: branches/upstream/libdevel-argnames-perl/current/t/001_basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-argnames-perl/current/t/001_basic.t?rev=70055&op=file
==============================================================================
--- branches/upstream/libdevel-argnames-perl/current/t/001_basic.t (added)
+++ branches/upstream/libdevel-argnames-perl/current/t/001_basic.t Mon Feb 28 10:59:16 2011
@@ -1,0 +1,20 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More 'no_plan';
+
+use ok 'Devel::ArgNames';
+
+sub foo { arg_names() }
+
+my ( $bar, $gorch, @blah );
+
+is_deeply(
+	[ foo($bar, $gorch, $blah[4]) ],
+	[ qw($bar $gorch), undef ],
+	"var names",
+);
+
+




More information about the Pkg-perl-cvs-commits mailing list