in reply to not getting hostname correctly on UNIX
system doesn't do what you want. You should be using backticks:
$hostname = `/bin/hostname`;
Also, you're needlessly using a global for a return value:
sub getHostname { return `/bin/hostname`; } my $hostname = getHostname; print "hostname: $hostname\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: not getting hostname correctly on UNIX
by blazar (Canon) on Dec 23, 2005 at 11:36 UTC |