Krambambuli has asked for the wisdom of the Perl Monks concerning the following question:
That's as readable as I could make it. Still, if later on, after being built, the resulting sql string is printed out for testing or is logged, the embedded newlines and spaces make the shown SQL string rather less appealing.my $sql = qq/ SELECT a.somedata1, a.somedata2, a.somedata3, [...] FROM table1 a, table2 b, table3 c WHERE a.somedata4 > ? /; $sql .= qq/ AND a.somedata5 <= ? AND [...] / if some_perl_code_condition1; $sql .= qq/ AND b.somedata6 >= ? [...] / if some_perl_code_condition2; $sql .= qq/ORDER BY somedata7 /;
|
|---|