in reply to Re^2: Perl style/best practice question: how to [better] embed SQL in code ?
in thread Perl style/best practice question: how to [better] embed SQL in code ?

The OP specifically requested removing new lines and white space for testing and logging. The format is busy, but it also sets the SQL clearly apart from the surrounding Perl.
  • Comment on Re^3: Perl style/best practice question: how to [better] embed SQL in code ?

Replies are listed 'Best First'.
Re^4: Perl style/best practice question: how to [better] embed SQL in code ?
by jeffa (Bishop) on Dec 16, 2008 at 19:01 UTC

    The format is too busy and does anything but set the SQL clearly apart from the surrounding Perl.

    If the OP needs to have the white space removed for testing and logging -- then remove it for testing and logging!

    $sql =~ s/\s+/ /g;
    I use this all the time so that I can keep my embedded SQL multi line and free of Perl while still being able to log single lines.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)