[ic] perl error setting scratch variable

Kevin Walsh interchange-users@interchange.redhat.com
Fri Apr 12 14:34:00 2002


> 
> If anyone can look at this and tell me where the error is I would really
> appreciate it.
> Here is the code:
> 
> [perl tables="userdb"]
>   @subscriptions = split(/\s+/, $Tag->data('userdb', 'mail_list',
> $Values->{mv_username});
>   foreach $my_item (@subscriptions) {
>     $Tag->set('subscriptions', $my_item . '=Y' );
>   }
> [/perl]
> 
Change that set() thing to this:

    $Scratch->{subscriptions} .= "$my_item=Y";

...that seems to be the intent of your code, but you will end
up with a string like this:

    foo=Ybar=Yhello=Yworld=Y

I said 'intent' because each iteration of your loop would
just overwrite the previous value and seems wrong to me.

What is it that you're trying to do?

By the way, the syntax error is probably caused by the lack of a
closing bracket on the @subscriptions line.  You seem to have
a mismatch there.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/