in reply to Re: Re: Constant subroutines thoughts
in thread Constant subroutines thoughts

It would be nice if you could declare inline functions explicitly rather than implicitly using this empty bracket "trick". I had no idea that Perl did this sort of magic for you under special circumstances. Maybe I haven't read enough of the latest Camel Book, because the older one didn't seem to make much of a big deal about it.

I think the reason I was so befuddled by it in the first place is because it didn't make any sense that Perl would do that sort of thing, I mean, other languages you've got to tell them to do this for you.

Replies are listed 'Best First'.
Re: Re^3: Constant subroutines thoughts
by Courage (Parson) on Jun 09, 2002 at 14:16 UTC
    Seems like I fallen into the same sort of confusion as you did. Anyway, as I mentioned, this is documented in "perlsub.pod", section "Constant Functions", and, if you're not pleased by bracket trick, then use "constant" module which does the same thing behind the scenes, and will be more portable just in case such mechanics will change...

    Courage, the Cowardly Dog.
    PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.