Hi,
I've attempted to use if, else in the following;
print "$acrLoopIP\n";
if ($acrLoopIP eq "") {
my $ACRip = $acrLoopIP;
} else {
$ACRblock = new2 Net::Netmask ($acrLoopIP);
my $ACRip = $ACRblock->base();
}
print "$Site, $ACRip\n";
This produces the output;
172.20.0.3/32
Brighton,
172.20.0.3/32
Bristol,
So $acrLoopIP is not "", but $ACRip is not begin calculated.
If I run the same section, without the if else statement it works fine;
print "$acrLoopIP\n";
$ACRblock = new2 Net::Netmask ($acrLoopIP);
my $ACRip = $ACRblock->base();
print "$Site, $ACRip\n";
Output is;
172.20.0.3/32
Brighton, 172.20.0.3
172.20.0.3/32
Bristol, 172.20.0.3
$acrLoopIP is 172.20.0.3/32 and $ACRIP is calcuated as 172.20.0.3
Can anyone point out where I'm going wrong?
Cheers,
I've attempted to use if, else in the following;
print "$acrLoopIP\n";
if ($acrLoopIP eq "") {
my $ACRip = $acrLoopIP;
} else {
$ACRblock = new2 Net::Netmask ($acrLoopIP);
my $ACRip = $ACRblock->base();
}
print "$Site, $ACRip\n";
This produces the output;
172.20.0.3/32
Brighton,
172.20.0.3/32
Bristol,
So $acrLoopIP is not "", but $ACRip is not begin calculated.
If I run the same section, without the if else statement it works fine;
print "$acrLoopIP\n";
$ACRblock = new2 Net::Netmask ($acrLoopIP);
my $ACRip = $ACRblock->base();
print "$Site, $ACRip\n";
Output is;
172.20.0.3/32
Brighton, 172.20.0.3
172.20.0.3/32
Bristol, 172.20.0.3
$acrLoopIP is 172.20.0.3/32 and $ACRIP is calcuated as 172.20.0.3
Can anyone point out where I'm going wrong?
Cheers,