in reply to Tell perl to use an alternate hosts file?

raindog308:

As wwe said, just do the name resolution in your application. To do so, you need only give an IP address instead of the hostname. Something like:

# Your host override hash my %hosts = ( 'foo.bar.com'=>'1.2.3.4', 'bar.baz.com'=>'4.3.2.1', ); . . . . . . # Get your server name from whereever my $server = XXXXXXX; # Override the server name if you have an override $server = $hosts{$server} if exists $hosts{$server}; # and pass it along to the function/service you're using... my $result = function_wanting_host($server);

...roboticus

When your only tool is a hammer, all problems look like your thumb.