On 10/26/2005 11:12 PM, Kevin Walsh wrote:
UserTag mytag Order title description
UserTag mytag Routine <<EOR
sub {
my ($title,$description) = @_;
...
}
EOR
Or (untested, but should work) ...
UserTag mytag Routine <<EOR
sub {
my ($opt) = @_;
my ($title,$description) = @suppressed'title','description'}};
}
EOR
Which, to explain the above, dereferences $opt into a hash, then
produces an array slice from the hash elements corresponding to the
title and description keys, then dereferences $Scratch into a hash and
produces an array slice from it using the above array as the keys.
Note that this will fail miserably if you fail to pass either title or description attributes to the tag, or if they don't match a corresponding scratch variable.
To be honest (and for my 2 cents) I tend to like Kevin's workaround of using [mytag title="[scratch title]"] the best for the following reasons...
1) You can use that workaround on other existing tags without having to modify the tag itself.
2) You can still call your own tag with [mytag title="My title"] from other places without having to set the title in a scratch.
3) It's really not that much less efficient than the other methods mentioned to be worth it (imo). To me, the most inefficient operations are database and file accesses and that workaround doesn't require any more of either one.
Peter _______________________________________________ interchange-users mailing list suppressed http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.