Re: [htmltmpl] mod_perl usage
Brought to you by:
samtregar
From: Matthew B. <dr...@ma...> - 2006-03-07 15:22:13
|
Hmm. I am using strict, but I do have many "globals". Here are the first few lines of our program: #!/usr/bin/perl use strict; use warnings; use lib '/path/to/something/'; use tools qw($dbh $webpage_obj &displayError $template &messageDie); $template = new HTML::Template(filename => '/home/omnovia/public_html/pages/sctest/templates/background.tpl', path => '/home/omnovia/public_html/pages/sctest/templates/', cache => 1, debug => 1, stack_debug => 1, cache_debug => 1, die_on_bad_params => 0); tools::DBConnect(); my ($companyID, $firstName, $lastName, $companyUsername); <several more lines of my's before getting into functions> Interestingly enough, companyID (the main var) is listed in the first my block. So that's global scope and would not be cleared? Beginning to make sense now. $companyID is used in just about every function, which is why it was made global. Should I instead write a function that gets all the vars from the web call and just pass them in between function calls? As I'm sure you have all learned by now, I'm not a perl programmer.. Thanks, -Matthew |