[ic] sql queries inside perl tag

interchange-users@lists.akopia.com interchange-users@lists.akopia.com
Wed Aug 1 22:37:00 2001


On Wed, Aug 01, 2001 at 09:50:35PM -0400, Brian Kosick wrote:
> Forgive me for sounding ignorant, plus I'm coming up on 13 hour work day 
> here so there are mis-firing synapses in my head, but where would I place 
> perl -W?
> 
> I tried switching the line in /usr/local/interchange/bin/interchange
> to read #!/usr/local/bin/perl -W

There is a "-w" and a "-W".  Try perl --help.  Pick up a copy of
"Learning Perl"; you can get through that small thin classic in just
a few hours.  Spending time researching and studying the archives
is necessary.



> >>
> >>Here's my code:
> >>[perl]
> >>  my $suninfo = [sql]SELECT sun FROM products WHERE code = 
> >> '[item-code]'[/sql];
> >>  my $sunarray = split(/,/, $suninfo);


This is probably a quoting error.  Try
my $suninfo=qq`[sql]SELECT sun FROM products WHERE code = '[item-code]'[/sql]`;

That leaves qq`` syntax as an exercise for the reader.

cfm

-- 

Christopher F. Miller, Publisher                               cfm@maine.com
MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
1.207.657.5078                                         http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux