in reply to Re: Anonymous subroutines
in thread Anonymous subroutines

I'm not sure what behaviour you are admonishing here. The OP did not say "for no reason", but "for no apparent reason" - it seems clear that by this they mean "for no reason apparent to me". They saw some code using a construct that they considered unusual, so they asked about it. I see no condemnation or judgement here, only a request for enlightenment.

Replies are listed 'Best First'.
Re^3: Anonymous subroutines
by Bod (Parson) on Dec 11, 2023 at 19:11 UTC

    Spot on hv!

    The question was asked because I don't understand why one would write a sub like that. Having seen it twice in two very different settings from two different coders, I am either missing a reason to do it that way or it is how some people used to write code at one time. Both instances where I saw it are not recent bits of code.