1 package Object::Remote::FatNode;
9 $text =~ /^(\s+)/ && $text =~ s/^$1//mg;
13 my %maybe_libs = map +($_ => 1), grep defined, (values %Config, '.');
15 my @extra_libs = grep not(ref($_) or $maybe_libs{$_}), @INC;
17 my $extra_libs = join '', map " -I$_\n", @extra_libs;
23 -mObject::Remote::Connector::STDIO
29 -mObject::Remote::ModuleLoader
30 -mObject::Remote::Node
31 -mMethod::Generate::BuildAll
32 -mMethod::Generate::DemolishAll
34 -e 'print join "\\n", reverse \%INC'
39 chomp(my %mods = qx($command));
41 my @non_core_non_arch = grep +(
42 not (/^\Q$Config{privlibexp}/ or /^\Q$Config{archlibexp}/)
43 ), grep !/\Q$Config{archname}/, grep !/\W$Config{myarchname}/, keys %mods;
45 my $start = stripspace <<'END_START';
46 # This chunk of stuff was generated by Object::Remote::FatNode. To find
47 # the original file's code, look for the end of this BEGIN block or the
52 my $end = stripspace <<'END_END';
53 s/^ //mg for values %fatpacked;
56 if (my $fat = $fatpacked{$_[1]}) {
57 open my $fh, '<', \$fat;
60 #Uncomment this to find brokenness
61 #warn "Missing $_[1]";
65 } # END OF FATPACK CODE
68 use Object::Remote::Node;
69 Object::Remote::Node->run;
72 my %files = map +($mods{$_} => scalar do { local (@ARGV, $/) = ($_); <> }),
76 (my $stub = $_) =~ s/\.pm$//;
77 my $name = uc join '_', split '/', $stub;
78 my $data = $files{$_}; $data =~ s/^/ /mg;
79 '$fatpacked{'.perlstring($_).qq!} = <<'${name}';\n!
80 .qq!${data}${name}\n!;
83 our $DATA = join "\n", $start, @segments, $end;