in reply to Help parsing this data
It looks like you want to build a family tree, so perhaps you'd like to use a array of hashes (AoH) with PID and COMMAND entries for each element, as you go down the family tree.
So the data structure for your data would look something like this:
The info I've left out is the PPID, but that would just be the previous entry's PID.@trace = ( { pid => 1, command = '/sbin/init' }, { pid => 7184, command = '/usr/bin/java' }, { pid => 7507, command = '/bin/sh' }, { pid => 7508, command = '/usr/bin/perl' }, { pid => 7515, command = 'sh' }, { pid => 7516, command = '<defunct>' }, );
|
|---|