|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Process orderby anniyan (Monk) |
| on Jun 09, 2006 at 11:14 UTC ( #554469=perlquestion: print w/ replies, xml ) | Need Help?? |
|
anniyan has asked for the
wisdom of the Perl Monks concerning the following question:
Monks i have hash in which i have 'Process' as key and 'Order' as value.
I want to do the processing of subroutines according to the precedence order given in the hash. For example in the above hash the 'PR3' should be executed first and 'PR1' second and so on. So in the following code, third subroutine should be processed first and first subroutine should be processed second and so on without changing the subroutine name. How to achieve this?
I can achieve this by using the subroutine name as a key in the above hash and can call the subroutines after sorting as shown below. But i want the process name as shown above like '&process1'... and should not be changed to '&PR1'.... as i have tried below.
I think that is not the correct way. Is there any module or any other way to do this? I can also achieve by writing combination of four subroutines with different orders but i know that is not correct method.
Regards,
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||