in reply to Re: Re^2: input switch
in thread input switch

I don't see any eval in the code of my other node.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re (5): input switch
by RatArsed (Monk) on Sep 09, 2002 at 12:22 UTC
    It's still doing a dispatch type of invocation. (so it's late bound) so at the lower levels, it's effectively the same as eval() to an extent -- you're still having to string comparison at runtime to check if the method exists, then invoking the late bound method, which naturally doesn't compile down as well as the early bound option which if...elsif... implies.

    --
    RatArsed

      There's no early binding in Perl. All method calls are symbolic lookups at run time. That means the if elsif method does a dispatch as well as a string comparison. Which is what I already said in my first reply on this thread branch.

      Makeshifts last the longest.

        Oops, my bad, I didn't see that.

        does seem a bit counter intuative to use a late binding method when you already know the method name. I could defned my solution in so much that if it is implemented in the future, then you automatically get the benefits it brings...

        --
        RatArsed