| 1 | package Net::DNS::Resolver::os2; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | our $VERSION = (qw$Id: os2.pm 2007 2025-02-08 16:45:23Z willem $)[2]; | ||
| 6 | |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Net::DNS::Resolver::os2 - OS2 resolver class | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | |||
| 15 | my $config_file = 'resolv'; | ||
| 16 | my @config_path = ( $ENV{ETC} || '/etc' ); | ||
| 17 | my @config_file = grep { -f $_ && -r $_ } map {"$_/$config_file"} @config_path; | ||
| 18 | |||
| 19 | my $homedir = $ENV{HOME}; | ||
| 20 | my $dotfile = '.resolv.conf'; | ||
| 21 | my @dotfile = grep { -f $_ && -o $_ } map {"$_/$dotfile"} grep {$_} $homedir, '.'; | ||
| 22 | |||
| 23 | |||
| 24 | sub _init { | ||
| 25 | my $defaults = shift->_defaults; | ||
| 26 | |||
| 27 | $defaults->_read_config_file($_) foreach @config_file; | ||
| 28 | |||
| 29 | %$defaults = Net::DNS::Resolver::Base::_untaint(%$defaults); | ||
| 30 | |||
| 31 | $defaults->_read_config_file($_) foreach @dotfile; | ||
| 32 | |||
| 33 | $defaults->_read_env; | ||
| 34 | return; | ||
| 35 | } | ||
| 36 | |||
| 37 | |||
| 38 | 1; | ||
| 39 | __END__ |