$VAR1 = {
'15746' => {
'ppid' => '15741',
'name' => 'echo Hello World'
},
'15747' => {
'ppid' => '15741',
'name' => './bye.pl'
},
'15741' => {
'ppid' => 'NA',
'name' => './hello_world.pl'
},
'15748' => {
'ppid' => '15747',
'name' => 'echo Bye World'
}
};
####
$VAR1 = {
'data' => {
'./strict.pm' => {
'pid' => {
'15747' => 1,
'15741' => 1
}
},
'./hello_world.pl' => {
'pid' => {
'15741' => 2
}
},
'./bye.pl' => {
'pid' => {
'15747' => 2
}
},
'./bin-perl' => {
'pid' => {
'15747' => 1,
'15741' => 1
}
}
},
'total' => {
'./strict.pm' => 6,
'./hello_world.pl' => 4,
'./bye.pl' => 4,
'./bin-perl' => 2
}
};
####
sub parents
{
my ($name,$pid,$processes_href) = @_;
unless(exists($processes_href->{$pid})) {
return '';
}
my $secondname = $processes_href->{$pid}{name};
if ($name eq $secondname) {
return parents($secondname,$processes_href->{$pid}{ppid},$processes_href);
}
return ",".$secondname.parents($secondname,$processes_href->{$pid}{ppid},$processes_href);
}
sub create_chain
{
my ($processes_href,$paths_href) = @_;
foreach my $data (keys(%{$paths_href>{'data'}})) {
while (my ($file, $procs) = each %{$data}) {
foreach my $pid (keys(%{$procs->{'pid'}})) {
print $fh $file.parents($file,$pid,$processes_href)."\n";
}
}
}
close($fh);
}
####
./strict.pm,./hello_world.pl
./strict.pm,./bye.pl,./hello_world.pl
./hello_world.pl
./bye.pl,./hello_world.pl
./bin-perl,./hello_world.pl
./bin-perl,./bye.pl,./hello_world.pl
####
tree ./regexpu-core/
|-- LICENSE-MIT.txt
|-- README.md
|-- data
| |-- character-class-escape-sets.js
| `-- iu-mappings.json
|-- package.json
`-- rewrite-pattern.js
####
`-- hello_world.pl
|-- bin-perl
|-- bye.pl
| |-- bin-perl
| `-- strict.pm
`-- strict.pm