Right off the bat, you've got a missing closing brace } somewhere in the code, that is likely triggering many of the other errors.
I started trying to sort it out, but your code is so poorly indented it is difficult, but appears you aren't closing this for loop: for my $NODE (@sContent){.
Get in the habit of indenting your code properly, otherwise these types of issues can be hard to track down. Indent once for each block:
sub this { for (@this){ print "this\n"; if ($thing){ print $thing; } } }
Also, don't define your variables at the top of each sub like that... Declare them right before or as they are used, especially in a for loop:
foreach my $FQDN (...){
Cleaning up your code layout will allow you to spot issues with closing braces much more readily, and that alone will allow you to sort out the other issues one at a time, and visually see which scope everything is supposed to and is in.
Also, you have a lot of erroneous whitespace... sometimes items after commas have a space, sometimes not. You use brackets inconsistently as well. Putting a & before a function call isn't required. It's legacy, and currently is only needed in certain circumstances, none of which you're using. Using a consistent style helps tremendously.
-stevieb
In reply to Re: Compilation error in the perl script
by stevieb
in thread Compilation error in the perl script
by shroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |