M
manunderstress
in the code below, why will it print (and add to the hash) $status but
not $ifconfig? Also when $status = "Production"; it fails to print or
add to hash as well.
something about variable evaluation/interpretation i'm not
understanding?
#ifconfig command on a solaris box; outputs multiple lines of text
my $ifconfig=`ifconfig -a`;
my $status='Production';
my @params = qw(status ifconfig);
foreach $item (@params) {
if (defined $item) {
print "item name: $item item value:". ${$item}. "\n";
$post_checks{"$item"} = "${$item}";
}
}
not $ifconfig? Also when $status = "Production"; it fails to print or
add to hash as well.
something about variable evaluation/interpretation i'm not
understanding?
#ifconfig command on a solaris box; outputs multiple lines of text
my $ifconfig=`ifconfig -a`;
my $status='Production';
my @params = qw(status ifconfig);
foreach $item (@params) {
if (defined $item) {
print "item name: $item item value:". ${$item}. "\n";
$post_checks{"$item"} = "${$item}";
}
}