in reply to Re: (jeffa) 2Re: SQL Query
in thread SQL Query
A good use for here docs is for user display, and i don't mean debugging. But since i discovered the wonderful world of templating, i haven't used a here doc in a long, long time.
I rather like this quick and dirty method of encapsulating a SQL query, i really think that here docs add line noise:
All i need is a pair of single quotes. But, this week taught me a pretty important lesson - there really are CPAN modules that take away having to even worry about such issues ... check out the replies by princepawn and autarch at Save MP3 Tag's to Database with SPOPS. (please note that SPOPS itself is meant for much more than what i presented.)sub get_artists { my $artist = shift() . '%'; return $dbh->selectcol_arrayref(' select name from artist where name like ? ',undef,$artist); }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR F--F--F--F--F--F--F--F-- (the triplet paradiddle)
|
|---|