Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit f4179af8b2497a53ee4349a5ad1687677a875c0a @phlipper committed Apr 15, 2012
Showing with 69 additions and 0 deletions.
  1. +48 −0 README.md
  2. +21 −0 cpan_list.pl
@@ -0,0 +1,48 @@
+# cpan_list
+
+Print out a list of installed CPAN packages along with a note about new versions available.
+
+
+## Platform
+
+Perl 5
+
+
+## Usage
+
+```
+$ perl cpan_list.pl
+```
+
+**Output:**
+
+```
+AnyDBM_File 1.00, NEW VERSION=1.01
+App::Ack 1.96
+Archive::Extract 0.38, NEW VERSION=0.60
+Archive::Tar 1.54, NEW VERSION=1.84
+Archive::Tar::Constant 0.02, NEW VERSION=1.84
+Archive::Tar::File 0.02, NEW VERSION=1.84
+Attribute::Handlers 0.87, NEW VERSION=0.93
+Attributes 0.12, NEW VERSION=2.60
+AutoLoader 5.70, NEW VERSION=5.72
+AutoSplit 1.06
+...
+```
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+
+## License
+
+**cpan_list**
+
+* Freely distributable and licensed under the [MIT license](http://phlipper.mit-license.org/2007-2012/license.html).
+* Copyright (c) 2007-2012 Phil Cohen (github@phlippers.net) [![endorse](http://api.coderwall.com/phlipper/endorsecount.png)](http://coderwall.com/phlipper)
+* http://phlippers.net/
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl -w
+
+use CPAN;
+
+# list all modules on my disk and note the newer versions
+for $mod (CPAN::Shell->expand("Module", "/./")) {
+ next unless $mod->inst_file;
+
+ # here only when installed
+ if ($mod->inst_version eq "undef") {
+ printf "%s :No VERSION\n", $mod->id;
+ }
+ elsif ($mod->uptodate) {
+ printf "%s %s\n", $mod->id, $mod->inst_version
+ }
+ else {
+ # here when not up to date
+ printf "%s %s, NEW VERSION=%s\n", $mod->id, $mod->inst_version,
+ $mod->cpan_version;
+ }
+}

0 comments on commit f4179af

Please sign in to comment.