1 package System::Introspector::Processes;
6 my $pipe = $self->_open_ps_pipe;
8 $spec =~ s{(?:^\s+|\s+$)}{}g;
9 my @fields = map lc, split m{\s+}, $spec;
11 while (defined( my $line = <$pipe> )) {
13 $line =~ s{(?:^\s+|\s+$)}{}g;
14 my @values = split m{\s+}, $line, scalar @fields;
16 @row{ @fields } = @values;
22 # args is automatically included, since it has to be last
59 my $command = sprintf 'ps -eo %s', join(',', @Included, 'args');
60 open my $pipe, '-|', $command
61 or die "Unable to open pipe to '$command': $!\n";