Skip to content

Commit

Permalink
mail: overloaded hostname() definition causes error (#519)
Browse files Browse the repository at this point in the history
* In package "mailer", hostname() is a setter method for object attribute "hostname" (L48)
* Sys::Hostname auto-imports a hostname() which causes a conflict; as a result I cannot send a mail message with 'm' command
* Prevent auto-import of Sys::Hostname symbols to resolve this
  • Loading branch information
mknos committed Mar 25, 2024
1 parent e8e8dac commit 9c562ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/mail
Expand Up @@ -41,7 +41,7 @@ package
@ISA=qw(PerlPowerTools::mailprog);

use IO::Socket;
use Sys::Hostname; # Claims to be standard?
use Sys::Hostname qw();

%mailer::fields=(
user => undef,
Expand Down Expand Up @@ -83,7 +83,7 @@ sub new {
}
# Find my address...
if (! defined $ENV{HOSTNAME}) {
my $hostname=hostname();
my $hostname = Sys::Hostname::hostname();
if (! $hostname) {
die "Unable to find a reasonable hostname. Use \$HOSTNAME.\n";
}
Expand Down

0 comments on commit 9c562ab

Please sign in to comment.