princepawn has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::Template and the Binding of Package Variables
by broquaint (Abbot) on Oct 03, 2003 at 21:27 UTC | |
|
Re: Text::Template and the Binding of Package Variables
by perrin (Chancellor) on Oct 03, 2003 at 19:22 UTC | |
by princepawn (Parson) on Oct 03, 2003 at 19:56 UTC | |
by perrin (Chancellor) on Oct 03, 2003 at 20:31 UTC |