Experts - I have a snippet of code I can't figure out. I was hoping someone could help me here.
I have a file of IPv6 address that I need to format correct.
Example in:
I'm reading the file into @tstIPs and then I'm trying to loop through them and update accordingly into @testIPs using Net::IP per below.
open(FH, "<", $fh) or die "Can't open file: $fh$!\n";
my @tstIPs=<FH>;
close(FH);
foreach my $i (@tstIPs) {
my $tstip = new Net::IP ($i,6);
push @testIPs, $tstip->ip();
}
I'm getting the following error:
Can't call method "ip" on an undefined value at ./dbi.pl line 43.
I can't figure out what's going on here and need help.