Did you know that there is a hostname.exe on wk2?
That's very useful, knowing there's a cross platform (for limited values of platform) command for identifying the machine.
From now on all my alert e-mails should state where they originate.
Quiz: is there perhaps a module providing the equivalent of `hostname`?
yes (Score:1)
Re:yes (Score:2, Informative)
POSIX::uname works better:
Re:yes (Score:1)
Re:yes (Score:1)
Re:yes (Score:1)
Re:yes (Score:1)
--- Hostname-old.pm Thu May 23 16:02:04 2002
+++ Hostname.pm Thu May 23 16:09:41 2002
@@ -51,7 +51,12 @@
}
elsif ($^O eq 'MSWin32') {
- ($host) = gethostbyname('localhost');
+ eval {
+ local $SIG{__DIE__};
+ require POSIX;
+ $host = (POSIX::uname())[1];
+ };
+ ($host) = gethostbyname('localhost') u
Re:yes (Score:1)
Sys::Hostname is a core module, so patches should go to p5p.