in reply to (jeffa) 5Re: SQL Query
in thread SQL Query

Just a quick addition. Here documents have their pro and cons, and I take your point. However, one of the reasons for having a here doc is that you can set a different syntax highlighting. In Vim (or gvim) you can edit the perl.vim syntax file and impose a different set of colors for your SQL code. The only hairy thing is that you need to define a unique separator.
In my case, I have defined two areas where I want this particular double syntax, inside a qq{} string (without spaces before the brace. If I want normal perl syntax, I use qq {}) and inside here documents starting with <<SQL. This way I can decide which one to use, whether or not I am using hash variables inside my SQL string. I use bind vars inside my SQL, and they don't interfere with my double syntax highlighting.

The stylistic issue can be seen differently here, if we consider that we can have a separate syntax highlighting for embedded SQL (or HTML, XML, or whatever thing we are building from our Perl script).
More than style, I would say it is convenience, since syntax highlighting will catch typing mistakes before I close my editor. Since I produce and maintain several Perl/DBI scripts, I found a balance between how much to write and how much help I want to get from my editor. Besides, if I catch the error earlier, it's one time less that I have to fire the editor and modify the code.
OTOH, this benefit is lost when I send my code to somebody who doesn't benefit from this feature.
I just wanted to share my experience. A mix of personal taste and style.
_ _ _ _ (_|| | |(_|>< _|