select `in`.date,leads.* from leads left join `in` on `in`.lead_id = leads.id where `in`.date BETWEEN '{$start_date}' AND '{$end_date}'
[tbone@horse1 CPC]$ ./lead-query.pl 2003-10-01 2003-10-03 Text::Template=HASH(0x8111b3c) at ./lead-query.pl line 43. select `in`.date,leads.* from leads left join `in` on `in`.lead_id = leads.id where `in`.date BETWEEN '' AND '' [tbone@horse1 CPC]$
#!/usr/bin/perl #===================================================================== # DECLARATIONS #===================================================================== use strict; use Text::Template; #===================================================================== # SUBROUTINES #===================================================================== sub USAGE { " Usage : $0 start_date end_date You passed: $0 @ARGV "; } #===================================================================== # PROGRAM PROPER #===================================================================== @ARGV == 2 or die USAGE; my %data; our ($start_date, $end_date) = @ARGV; my $template = Text::Template->new (TYPE => 'FILE', SOURCE => 'lead-query.tt') or die "$Text::Template::ERROR"; warn $template; print $template->fill_in (PACKAGE => '__PACKAGE__' ); 1;
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.
In reply to Text::Template and the Binding of Package Variables by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |