in reply to Simple Template System That Supports Conditional Content?

I like HTML::Template, despite the name it does regular text templates as well as HTML.

Recently i've started using Template as well (not sure how to link to that one), its a bit heavier to use and install but comes with tons and tons of options.

These two have fit for me every time so I don't even look for others, might be out there but these are two that have been around the block.

Update:I assumed that your sample was just a sample, if you are actually working with SQL you probably want to use a different solution.

Something like:

my $update = { ADDRESS => 'test', customer_name => 'eric' }; my @cols = sort grep { defined $update->{$_}} keys %$update; my $sql = join (",", map { "$_ = ?" } @cols ); print "UPDATE test SET $sql WHERE id = ?"; #then you can use it like: # $dbh->execute("UPDATE test SET $sql WHERE id = ?",undef, map {%updat +e{$_}} @cols, $id);

___________
Eric Hodges