(RADIATOR) Several Hooks but only one Hook directive

Frank Danielson fdanielson at csky.com
Wed Nov 2 11:09:40 CST 2005


There's two ways I can think of to accomplish this effect-

One is to create file taskA.pl, taskB.pl, and taskC.pl with each having the
task as a subroutine like sub taskA {}. Then you create individual hooks
called something like taskAB.pl that look something like this-

include taskA.pl
include taskB.pl

&taskA();
&taskB();

Or just make one hook with all of the task as subroutines and use if then
statements to decide which ones to run. This gives you one file to maintain
and allows some continuity between tasks if needed.

if (condition AB) {
	&taskA();
	&taskB();
} elsif (condition BC) {
	&taskB();
	&taskC();
}

sub taskA {
	A tasks;
}

sub taskB {
	B tasks
}

sub taskC {
	C tasks
}
	

Frank Danielson
Infrastructure Architect

ClearSky Mobile Media
56 E. Pine St.
Orlando, FL 32801
USA

fdanielson at csky.com
-----Original Message-----
From: PREVOSTO, Laurent [mailto:Laurent.PREVOSTO at neufcegetel.fr]
Sent: Wednesday, November 02, 2005 11:02 AM
To: radiator at open.com.au
Subject: (RADIATOR) Several Hooks but only one Hook directive


Hi,
 
I suppose it's not possible but maybe there is some kind of trick to do such
a thing :
Is there a way to sequentially run several hooks with the same XxxxxHook
directive.
I mean something like :
PostAuthHook file:"%D/foo.pl", file:"%D/bar.pl"
 
That would allow me to only deal with a few files instead of having (and
maintaining) :
the file that does the A task 
the file that does the B task 
the file that does the C task 
the file that does the A and the B tasks 
the file that does the B and C tasks 
the file that does the A and B and C tasks 
etc... 
 
 
Regards 
 
Laurent

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list