[ic] Function inside user tag

Marco Mescoli m.mescoli at omnib.it
Fri Nov 23 12:05:49 EST 2007


Ok.
Powerful.
Thank you.
Marco

Mike Heins ha scritto:
> Quoting Peter (peter at pajamian.dhs.org):
>> On 11/23/2007 03:28 AM, Marco Mescoli wrote:
>>> Is it possible declare and call a perl function inside user tag ?
>>> Digged mailing list without any example ...
>> I usually do something like:
>>
>> ...................
>>
>> # Declare sub foo
>> my $foo = sub {
>> 	my ($bar, $baz) = @_;
>> }
>>
>>
>> # Call foo
>> &$foo($bar, $baz);
>>
>> ...................
>>
>>
>> I think you can also just declare the sub and call it, but I've never
>> tried it.  I know the above works, though.
>>
> 
> It works to the point that you can create packages, modules, and
> everything else and call them.
> 
> In fact, you will see Usertags like [get-url] "require" modules then
> use their routines. And we frequently define subs in UserTags.



More information about the interchange-users mailing list