use env in shbang
[gitmo/moose-presentations.git] / moose-class / exercises / install-moose
index 0d8379b..1e4d5c8 100755 (executable)
@@ -1,14 +1,19 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use Cwd qw( abs_path );
 use CPAN;
 use File::Spec;
 
-CPAN::Config->load;
+if ( CPAN::HandleConfig->can('load') ) {
+    CPAN::HandleConfig->load();
+}
+else {
+    CPAN::Config->load();
+}
 
-$CPAN::Config->{urllist} =
-    [ 'file://' . File::Spec->catdir( abs_path(q{.}), 'moosepan' ),
-      @{ $CPAN::Config->{urllist} } ];
+$CPAN::Config->{connect_to_internet_ok} = 0;
+$CPAN::Config->{urllist}
+    = [ 'file://' . File::Spec->catdir( abs_path(q{.}), 'moosepan' ) ];
 
 CPAN::Shell->install('Moose');