[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] bareword error in perl
> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of Paul
> Jordan
> Sent: Thursday, May 23, 2002 10:28 PM
> To: Interchange list
> Subject: [ic] bareword error in perl
>
>
> Hi
>
> I am trying to install a usertag but am getting a bareword error:
> ------------------------
> Bareword "products" not allowed while "strict subs" in use at (eval 138)
> line 27, <CONFIG> line 46.
>
> In line 46 of the configuration file 'etc/after2.cfg':
> UserTag im_onfly Routine <<EOR
> ------------------------
>
>
> This is the area in question:
>
> 21 $base_sku =~ s/^\s+|\s+$//g;
> 22 $append =~ s/^\s+|\s+$//g;
> 23 return {} unless ($base_sku && $append);
> 24
> 25 my $query = qq{
> 26 SELECT pp.price, pp.download, pp.weight, pd.title, pd.description
> 27-> FROM products pd, properties pp
> 28 WHERE pd.cap_group = pp.cap_group
> 29 AND pd.code = '$base_sku'
> 30 AND pp.append = '$append'
> 31 };
> 32 my $db = ::database_exists_ref(products) or die 'Bad products table';
> 33 my $resultset = $db->query($query);
> 34 return {} unless scalar @$resultset;
>
>
> How would I go about correcting this? I have tried surrounding the query
> with
>
The error is actually on line 32. Change to
my $db = ::database_exists_ref('products') or die 'Bad products table';
(added some quotes)
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/