in reply to Perl IF Issue
Good $localtime
I see this in your code:
message("host test : $HOSTNME"); ----> testing to check current hostname(good)
I guess $HOSTNAME is the name of the host you are running on. If so a nice portable way to get this, is to use Sys::Hostname (in Perl Core)
Sys::Hostname creates the constant hostname that provides a nice clean, portable, line break free instance of your hostname. You may want to copy it to $host for easier use in strings:use strict; use warnings; use Sys::Hostname; print "I am running on:". hostname .", thank you and goodnight\n";
use strict; use warnings; use Sys::Hostname; my $host = hostname; print "I am running on: $host, thank you and goodnight\n";
Cheers,
R.
|
---|