Uninitialized values for arrays suddenly appear in early
subs after I created private var in last sub. I am
really trying to be clear! The script searches html files
for terms input by a form. I am trying to add code which
would append the search results HTML to an open ended
block of HTML called top.html
The script was working fine until
I added this to the fourth sub at around line 150:
open(FH,"../top.html") || die "couldn't open file $!\n";
my @html=<FH>;
close(FH);
print @html;
Now I get unitialized values for:
@pairs = split(/&/, $buffer); at line 34 in the first sub
@terms = split(/\s+/, $FORM{'terms'}); at line 71 in the third sub
The arrays aren't declared in the variable declarations but this caused
no errors until I added the private variable. BTW the little block of code I
added works fine as a standalone (thanks to
mandog)
I suspect this is too vague to be answered but I really hope someone can help!
TIA
jg