Jim has asked for the wisdom of the Perl Monks concerning the following question:
What's the best (as in Best Practices) template system to use for incidental and trivial formatted printing tasks like this one, which includes conditional content?
I don't mind using a CPAN module, of course; indeed, I expect I'll have to. But I'm hoping to avoid being overwhelmed by the surfeit of available choices. This commonplace task has got to be easier than it seems from my research of the many options.# Fabricated but verisimilar example printf "UPDATE %s SET\n", $table_name; printf "CUSTOMER_NAME = '%s'", $customer_name; printf ",\nAGE = %d", $age if defined $age; printf ",\nSTATUS = '%s'", $status if defined $status; printf ",\nADDRESS = '%s'", $address if defined $address; printf ",\nPHONE = '%s'", $phone if defined $phone; printf "\nWHERE CUSTOMER_NUMBER = %d;\n\n", $customer_number;
Thank you!
Jim
|
|---|