[ic] getting errors trying to push data into cart

kenshin@planetanime.com interchange-users@icdevgroup.org
Wed Dec 11 18:00:01 2002


Hi all,
I'm trying to write a script that take various values passed to it from a
form combine them into a sku and push that sku into a cart.
After searching thru the list I've come up with the following script:

 x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

my $cn1_style = $CGI->{connector1_style};
my $cn2_style = $CGI->{connector2_style};
my $cable_type = $CGI->{cable_type};
my $cable_color = $CGI->{cable_color};
my $glue = "-";
my %myhash = (
  price_group => "",
  code => $cable_type . $glue . $cn1_style . $glue . $cn2_style,
  mv_ib => "options",
  quantity => "1"
);

push @{$Carts->{main}},\%myhash;
return;

 x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

But I am receiving the following error and the item is not added to the cart:

 x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

'last_error' => 'Safe: syntax error at (eval 346) line 3, near "my \\"

my \\$cn1_style = \\$CGI->{connector1_style};
my \\$cn2_style = \\$CGI->{connector2_style};
my \\$cable_type = \\$CGI->{cable_type};
my \\$cable_color = \\$CGI->{cable_color};
my \\$glue = \\"-\\";
my %myhash = (
  price_group => \\"\\",

  code => \\$cable_type . \\$glue . \\$cn1_style . \\$glue . \\$cn2_style,

  mv_ib => \\"options\\",

  quantity => \\"1\\"
);

push \\@{\\$Carts->{main}},
\\\\%myhash;
return;

 x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

and the values being passed

 x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

###### CGI VALUES      #####
{
          'imageField.x' => '7',
          'mv_form_profile' => 'add_cart_item',
          'imageField.y' => '7',
          'connector2_style' => '3pin_xlr',
          'connector2_family' => 'xlr',
          'connector1_family' => 'xlr',
          'connector1_style' => '3pin_xlr',
          'mv_nextpage' => 'view_cart.html',
          'connector2_gender' => 'male',
          'cable_color' => '-------------------------',
          'cable_type' => 'canare_duplex',
          'connector1_gender' => 'male',
          'mv_doit' => 'return',
          'mv_session_id' => 'uZdk52j9'
        }

###### END CGI VALUES  #####

Any clues?  I've assigned local variables like this before without any
problems.
Thanks.
Mike k

Perl 5.6.1, Interchange 4.8.6, Apahce 1.3.27