moved additional modules into trace() method
[p5sagit/App-FatPacker.git] / lib / App / FatPacker.pm
index 0c11330..ccd0176 100644 (file)
@@ -89,12 +89,25 @@ sub script_command_trace {
     }
   };
 
-  if(@additional_use) {
-    $arg .= "," . join ",", @additional_use;
+  $self->trace(
+    use    => \@additional_use,
+    args   => $args,
+    output => $arg,
+  );
+}
+
+sub trace {
+  my ($self, %opts) = @_;
+  my $use = $opts{'use'};
+  my $args = $opts{'args'};
+  my $output = $opts{'output'};
+
+  if(@$use) {
+    $output .= "," . join ",", @$use;
   }
 
   {
-    local $ENV{PERL5OPT} = '-MApp::FatPacker::Trace'.$arg;
+    local $ENV{PERL5OPT} = '-MApp::FatPacker::Trace'.$output;
     system $^X, @$args;
   }
 }