1 package System::Introspector::Probe::Hosts;
4 use System::Introspector::Util qw(
11 default => sub { '/etc/hosts' },
16 return transform_exceptions {
17 my $fh = $self->_open_hosts_file;
19 while (defined( my $line = <$fh> )) {
21 next if $line =~ m{^\s*$}
23 push @hosts, [split m{\s+}, $line];
25 return { hosts => \@hosts };
29 sub _open_hosts_file {
31 return handle_from_file $self->hosts_file;
40 System::Introspector::Hosts - Gather known hosts
44 Reads a C<hosts> file to produce a list of known hosts
50 The path to the C<hosts> file that should be read. Defaults to C</etc/hosts>.
56 =item L<System::Introspector>