[ic] Split description field into an array via perl

Kevin Walsh kevin at cursor.biz
Wed Aug 27 22:48:43 EDT 2003


K Old [kold at kold.homelinux.com] wrote:
> 
> [perl]
> my $desc = $Tag->item-description;
> return("$desc<br>");
> [/perl]
> 
> also tried
> 
> [scratch kotest value="[item-description]"]
> [perl]
> my $desc = $Tag->scratch(kotest);
> return("$desc<br>");
> [/perl]
> 
The following line, in your first example, will result in nothing
more than an entry in your error.log file:

    my $desc = $Tag->item-description;

As will the following line, in your second example:

    my $desc = $Tag->scratch(kotest);

The error.log entries should have explained the problems, or at the
very least, alerted you to the fact that the problems exist.

>
> Can someone throw me a line?
> 
You could access the scratchpad variable, in your second example,
using $Scratch->{kotest}.  Well, you could if you'd set the variable
correctly in the first place. :-)

Alternatively, you could rewrite your Perl as follows:

    [item-calc]
        my $desc = q{[item-description]};
        return "$desc<br>";
    [/item-calc]

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



More information about the interchange-users mailing list