in reply to Re^2: using template on same page
in thread using template on same page

Your script as posted doesn't compile for me. I get the following errors when running it:

Global symbol "$info" requires explicit package name (did you forget t +o declare "my $info"?) at tmp.pl line 9. Global symbol "$DBH" requires explicit package name (did you forget to + declare "my $DBH"?) at tmp.pl line 11. Global symbol "$info" requires explicit package name (did you forget t +o declare "my $info"?) at tmp.pl line 12. Global symbol "$names" requires explicit package name (did you forget +to declare "my $names"?) at tmp.pl line 13. Global symbol "$names" requires explicit package name (did you forget +to declare "my $names"?) at tmp.pl line 14. Global symbol "$names" requires explicit package name (did you forget +to declare "my $names"?) at tmp.pl line 14. Global symbol "$variable1" requires explicit package name (did you for +get to declare "my $variable1"?) at tmp.pl line 15. Global symbol "$variable2" requires explicit package name (did you for +get to declare "my $variable2"?) at tmp.pl line 15. Global symbol "$variable3" requires explicit package name (did you for +get to declare "my $variable3"?) at tmp.pl line 15. Global symbol "$names" requires explicit package name (did you forget +to declare "my $names"?) at tmp.pl line 15. Global symbol "@names" requires explicit package name (did you forget +to declare "my @names"?) at tmp.pl line 48. tmp.pl had compilation errors.

Can you please post the code you're actually running?

Also, if you're using strict.pm, it allows Perl to tell you when you forget to declare a variable. Going through your code and thinking about where you first use a variable will make you find typos in your script where you mistype a variable name, or mistype a variable type.