[ic] interpolate
Kevin Walsh
kevin at cursor.biz
Sun Mar 26 16:26:05 EST 2006
Jon <prtyof5 at attglobal.net> wrote:
> This UserTag foobar Order foo bar baz
>
> begets this [foobar foo="aaa" bar="bbb" baz="ccc"]
>
> The 'Order' is that literal ordering i.e. foo is first, bar is second, etc.
> or is that another variable with a value as in Order number ?
>
The "Order" defines two things:
1. The order in which positional parameters are expected:
2. The order in which the given parameters will be passed to
your code.
If I use the following example:
UserTag foobar Order foo bar baz
then the following tag calls are equivalent:
[foobar aaa bbb ccc]
[foobar baz="ccc" foo="aaa" bar="bbb"]
If the parameters are collected using the following code:
my ($one,$two,$three) = @_;
then above examples will will cause the following values to be set:
$one will be set to "aaa"
$two will be set to "bbb"
$three will be set to "ccc"
Of course, it's nicer to name the variables after the Order values,
like this:
my ($foo,$bar,$baz) = @_;
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
More information about the interchange-users
mailing list