1 package System::Introspector::Probe::Processes;
4 use System::Introspector::Util qw(
9 # args is automatically included, since it has to be last
46 my @names = (@Included, 'args');
47 return transform_exceptions {
48 my $pipe = $self->_open_ps_pipe;
50 $spec =~ s{(?:^\s+|\s+$)}{}g;
51 my @fields = map lc, split m{\s+}, $spec;
53 while (defined( my $line = <$pipe> )) {
55 $line =~ s{(?:^\s+|\s+$)}{}g;
56 my @values = split m{\s+}, $line, scalar @fields;
58 @row{ @names } = @values;
61 return { processes => [ sort {
62 ($a->{args} cmp $b->{args})
64 ($a->{pid} <=> $b->{pid})
71 return handle_from_command sprintf
73 join(',', @Included, 'args');
82 System::Introspector::Processes - Gather running processes
86 Uses C<ps> to gather a list of all running processes.
92 =item L<System::Introspector>