perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

[doc] No documentation about our $host and used environment variables

Open KES777 opened this issue 3 years ago • 2 comments

Where Sys::Hostname

Description Please document $Sys::Hostname::host variable and $ENV{*} variables which are used to detect hostname.

KES777 avatar Aug 06 '22 10:08 KES777

Where Sys::Hostname

Description Please document $Sys::Hostname::host variable and $ENV{*} variables which are used to detect hostname.

I don't see a strong need to add to this:

NAME
Sys::Hostname - Try every conceivable way to get hostname

SYNOPSIS
    use Sys::Hostname;
    $host = hostname;

DESCRIPTION
Attempts several methods of getting the system hostname and then caches the
result. ...

What exactly do you find inadequate there?

I think the particular $ENV{...} variables the module uses are internal implementation details.

jkeenan avatar Aug 06 '22 12:08 jkeenan

The problem was how to mock hostname. I can use $Sys::Hostname::host = 'manual' to mock it. Also I was thinking about:

HOSTNAME=manual perl some_application.pl

KES777 avatar Aug 07 '22 18:08 KES777