in reply to subroutine referencing

I was looking at your code and it is pretty megre so disregard this if it is not what I think. Could you use AUTOLOAD on your $image object then use a regex to normalize the sub call to your calling convention then call the function or something along those lines rather than having a hash with all the possible variations in it?

Just a thought.

Replies are listed 'Best First'.
Re: Re: subroutine referencing
by dragonchild (Archbishop) on Mar 10, 2004 at 13:30 UTC
    I'm assuming that the OP is using either GD or ImageMagick, so the answer would most likely be no.

    Also, the technique is very useful in other situations. What the OP has is very similar to a dispatch table, but is a list of method names, not subroutine references.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.