[Oc-pm] Chain of subs...

Wilson, Douglas dgwilson at sonomasystems.net
Fri Jul 9 12:32:30 CDT 2004



> -----Original Message-----
> From: Wyatt Draggoo [mailto:wyatt at draggoo.com]
> Sent: Friday, July 09, 2004 10:09 AM
> To: oc-pm at pm.org
> Subject: [Oc-pm] Chain of subs...
> 
> 
> I'm writing a log parser for some things at work, and am 
> trying to figure
> out the best way to run each line of the log through a chain 
> of subroutines.
> 
> Is an array of sub references the best way to go for this?

That seems as good a way to go as any. Then you can easily
add or remove any of the parsing actions. But if you
are doing some of the same things in each subroutine (e.g.
parsing the line into tokens), then you might think about
doing some of the work before passing off the rest of the
work to the subs.



More information about the Oc-pm mailing list