[ic] Having a UserTag program (causing Internal State Error)

the OnE bicolspice at yahoo.com
Mon Jul 5 20:44:21 EDT 2004

Anybody wanna help me figure out the problem with this
tag. This is my first UserTag...

# Purpose: Count the number of attribute values an
item has.
# Usage: [attribute_count code=B1001  attribute=ink]

UserTag attribute_count Interpolate
UserTag attribute_count Order code attribute
UserTag attribute_count Routine <<EOF

sub {
  my ($code, $attribute) = @_;
  my $results = $Tag->query(
                  sql => "select $attribute from
                          where sku = '$code'"

  $_ = $results->[0]->[0];
  my @temp = split(/, */, $_);
  $Scratch->{attribute_count_debug}  = scalar @temp;
  return scalar @temp;  #return the number of items

in my flypage.html

I call this tag as

[attribute_count code=BR0001 attribute=ink]

In my database, the item with sku=BR0001 has an ink
value of ink=I4O4=4 color process&comma; both sides*

Unfortunately, the UserTag causes an Internal State


tail -f /usr/local/interchange/interchange.cfg gJJuHYia: -
[06/July/2004:08:41:36 -0400] cpws
/cgi-bin/cpws/BusinessCards.html Runtime error: Can't
use string ("") as an ARRAY ref while "strict refs" in
use at (tag 'attribute_count') line 9.

Hoping for a quick response.. thank you!!


Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

More information about the interchange-users mailing list