[Denver-pm] Better way to handle vars?

Stuart A Johnston saj at thecommune.net
Tue Jul 1 15:28:56 PDT 2014


I think we'd need a bit more detail to answer your exact question but 
you might find this article helpful:

http://www.perl.com/pub/2001/03/dbiokay.html


On 07/01/2014 04:22 PM, Robert L. Harris wrote:
>
> OK, so I'm parsing a ton of data based on patterns in the lines.  Given
> the line I pull out 3 things,
> Timestamp
> Key
> Value
>
> Right now for one of my patters I have
>
> $Insert="insert into table ( TIMESTAMP, KEY, VALUE ) values (
> $Timestamp, $Key, $Value )";
>
> ( effectively ).
>
> I'm going to have about 20+ of these patterns.  The actual insert is
> about 5x longer.  Is there a way to "template" the Insert so I can
> basically reference the template in the pattern and re-use the template?
>   That way if the template has to change down the line ( a new field
> added ) I update the template and not 20+ variables?
>
> Robert
>
>
> --
> :wq!
> ---------------------------------------------------------------------------
> Robert L. Harris
>
> DISCLAIMER:
>        These are MY OPINIONS             With Dreams To Be A King,
>         ALONE.  I speak for                      First One Should Be A Man
>         no-one else.                                     - Manowar
>
>
> _______________________________________________
> Denver-pm mailing list
> Denver-pm at pm.org
> http://mail.pm.org/mailman/listinfo/denver-pm
>



More information about the Denver-pm mailing list