Guest User

Untitled

a guest
Jun 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!perl
  2. use strict;
  3. use warnings;
  4. use PadWalker qw(peek_sub);
  5.  
  6. require 'path/to/cpanm';
  7.  
  8. my $extract_to = 'lib';
  9. my $fatpacked = peek_sub($INC[0])->{'%fatpacked'};
  10.  
  11. use File::Path qw(make_path);
  12. use File::Basename;
  13.  
  14. for my $path (keys %$fatpacked) {
  15. make_path dirname "$extract_to/$path";
  16. open my $fh, '>', "$extract_to/$path" or die "cannot open $path: $!";
  17. print $fh $fatpacked->{$path};
  18. close $fh;
  19. }
Add Comment
Please, Sign In to add comment