in reply to Re: Escaping and quoting ?????
in thread Escaping and quoting ?????

my $sql=<<"__SQL__";

Use of single-quote delimiters would avoid double-quotish interpolation entirely, with no need for  \ (backslash) escaping:
    my $sql=<<'__SQL__';
Please see here-docs in Quote and Quote-like Operators.