[ic] usertag passing args by reference (perl newby)
Stefan Hornburg
racke at linuxia.de
Wed Aug 27 08:33:06 UTC 2008
Marco Mescoli wrote:
> Dear list
> Is there an example to pass args to a usertag for reference or have more
> then one return value from a usertag?
Inside of embedded Perl / UserTags you can pass references back and forth
to Usertags.
In ITL you can do things like:
[calc] $Scratch->{example} = {foo => 'bar', duh => 'xxx'}; return; [/calc]
[mytag myarg=`$Scratch->{example}`]
You can also return something different from a usertag depending on the
caller:
if (wantarray()) {
return @path;
} else {
$joiner = $opt->{joiner} || ' ';
return join($joiner, @path);
}
If this tag is called from ITL, it will return the string.
If this tag is called from Perl/UserTag it depends on the context.
Regards
Racke
--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team
More information about the interchange-users
mailing list