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
26 -mObject::Remote::ModuleLoader
27 -mObject::Remote::Node
28 -mMethod::Generate::BuildAll
29 -mMethod::Generate::DemolishAll
31 -e 'print join "\\n", reverse \%INC'
36 chomp(my %mods = qx($command));
38 my @non_core_non_arch = grep +(
39 not (/^\Q$Config{privlibexp}/ or /^\Q$Config{archlibexp}/)
40 ), grep !/\Q$Config{archname}/, grep !/\W$Config{myarchname}/, keys %mods;
42 my $start = stripspace <<'END_START';
43 # This chunk of stuff was generated by Object::Remote::FatNode. To find
44 # the original file's code, look for the end of this BEGIN block or the
49 my $end = stripspace <<'END_END';
50 s/^ //mg for values %fatpacked;
53 if (my $fat = $fatpacked{$_[1]}) {
54 open my $fh, '<', \$fat;
60 } # END OF FATPACK CODE
63 use Object::Remote::Node;
64 Object::Remote::Node->run;
67 my %files = map +($mods{$_} => scalar do { local (@ARGV, $/) = ($_); <> }),
71 (my $stub = $_) =~ s/\.pm$//;
72 my $name = uc join '_', split '/', $stub;
73 my $data = $files{$_}; $data =~ s/^/ /mg;
74 '$fatpacked{'.perlstring($_).qq!} = <<'${name}';\n!
75 .qq!${data}${name}\n!;
78 our $DATA = join "\n", $start, @segments, $end;