[ic] Function inside user tag

Mike Heins mike at perusion.com
Fri Nov 23 08:45:30 EST 2007


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.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Find the grain of truth in criticism, chew it, and swallow
it. -- anonymous


More information about the interchange-users mailing list