in reply to Recursive anonymous subroutines

So I assume what you did is, to have a sub, which returns a sub routine, base on some sort of condition, either by using switch statement, or whole bunch of elsif.

Hm... This sub itself would be a giant, and I don't see this as a good style.

What you really should do, is to have all those subs well defined, give each of them a name THAT HELPS PEOPLE TO UNDERSTAND THEIR FUNCTONALITY. You can use ref to those subs to implement what you stated.

Replies are listed 'Best First'.
Re: Re: Recursive anonymous subroutines
by nohat (Initiate) on Oct 08, 2003 at 14:51 UTC
    Er, no, if you look at the code you will see the only difference between the different anonymous subs is which filehandle they read from. It is not possible to pass in the filehandle because they are used as callbacks. And the filehandles are all just members of an array, so there is no point in making separate subs for each, and besides I don't know how many there will be so it's not really possible anyway. -- Nohat