use Moo;
use System::Introspector::Util qw(
- handle_from_command
+ lines_from_command
transform_exceptions
);
sub gather {
my ($self) = @_;
return transform_exceptions {
- my $pipe = $self->_open_lsof_pipe;
+ my @lines = lines_from_command [$self->_lsof_command_call];
my @handles;
- while (defined( my $line = <$pipe> )) {
+ for my $line (@lines) {
chomp $line;
my @fields = split m{\0}, $line;
push @handles, { map {
};
}
-sub _open_lsof_pipe {
+sub _lsof_command_call {
my ($self) = @_;
- my $lsof = $self->lsof_command;
- return handle_from_command "$lsof -F0";
+ return $self->lsof_command, '-F0';
}
1;
=head1 NAME
-System::Introspector::FileHandles - Gather opened filehandles
+System::Introspector::Probe::FileHandles - Gather opened filehandles
=head1 DESCRIPTION
=back
-=cut
+=head1 COPYRIGHT
+
+Copyright (c) 2012 the L<System::Introspector>
+L<AUTHOR|System::Introspector/AUTHOR>,
+L<CONTRIBUTORS|System::Introspector/CONTRIBUTORS> and
+L<SPONSORS|System::Introspector/SPONSORS>.
+
+=head1 LICENSE
+This library is free software and may be distributed under the same terms
+as perl itself.
+
+=cut