[Bps-public-commit] App-moduleswhere branch, master, created. d40ae77ead07399aa0d4b2203f6b96d3fcd9c3ad

? sunnavy sunnavy at bestpractical.com
Wed Apr 27 02:33:35 EDT 2011


The branch, master has been created
        at  d40ae77ead07399aa0d4b2203f6b96d3fcd9c3ad (commit)

- Log -----------------------------------------------------------------
commit d40ae77ead07399aa0d4b2203f6b96d3fcd9c3ad
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 27 14:23:42 2011 +0800

    initial import

diff --git a/Changes b/Changes
new file mode 100644
index 0000000..09d2b89
--- /dev/null
+++ b/Changes
@@ -0,0 +1,6 @@
+Revision history for App-moduleswhere
+
+{{$NEXT}}
+
+    Initial release.
+
diff --git a/bin/mwhere b/bin/mwhere
new file mode 100755
index 0000000..34cc092
--- /dev/null
+++ b/bin/mwhere
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl 
+use strict;
+use warnings;
+
+use Getopt::Long;
+my %args;
+GetOptions( \%args, 'help|h' ) or exit;
+
+ at ARGV = grep { defined } @ARGV;
+
+if ( $args{help} || !@ARGV ) {
+    print <<'EOF';
+USAGE: mwhere Module [ ... ]
+EXAMPLES:
+    mwhere Carp                                    # show location of Carp.pm
+    mwhere Carp CGI                                # copy both Carp.pm and CGI.pm
+EOF
+    exit;
+}
+
+for my $mod (@ARGV) {
+    eval "require $mod" or warn "failed to require '$mod'\n" and next;
+
+    my @parts = split /::/, $mod;
+    my $inc = join( '/', @parts ) . '.pm';
+    my $source = $INC{$inc};
+    print $source, "\n";
+}
+
diff --git a/dist.ini b/dist.ini
new file mode 100644
index 0000000..9e77e48
--- /dev/null
+++ b/dist.ini
@@ -0,0 +1,12 @@
+name    = App-moduleswhere
+version = 0.01
+author  = sunnavy <sunnavy at bestpractical.com>
+license = Perl_5
+copyright_holder = Best Practical Solutions 
+
+[@Basic]
+[NextRelease]
+    format = %-6v %{yyyy-MM-dd HH:mm:ss VV}d
+[PodSyntaxTests]
+[Repository]
+    git_remote = http://github.com/bestpractical/app-moduleswhere.git
diff --git a/lib/App/moduleswhere.pm b/lib/App/moduleswhere.pm
new file mode 100644
index 0000000..5e18860
--- /dev/null
+++ b/lib/App/moduleswhere.pm
@@ -0,0 +1,43 @@
+package App::moduleswhere;
+
+use warnings;
+use strict;
+our $VERSION = '0.01';
+
+1;
+
+__END__
+
+=head1 NAME
+
+App::moduleswhere - show modules' locations
+
+=head1 SYNOPSIS
+
+    mwhere Carp                                    # show location of Carp.pm
+    mwhere Carp CGI                                # copy both Carp.pm and CGI.pm
+
+=head1 DESCRIPTION
+
+This small script(C<mwhere>) helps you show modules' locations.
+
+You may ask, why not using `perldoc -l`? well, if the module doesn't
+have any pod( this happens occasionally but does happen ), `perldoc -l` will
+fail, in this case, mwhere comes to rescue!
+
+=head1 BUGS AND LIMITATIONS
+
+No bugs have been reported.
+
+=head1 AUTHOR
+
+sunnavy  C<< sunnavy at bestpractical.com >>
+
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright 2011 Best Practical Solutions.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list