in reply to subroutine referencing

In the spirit of TMTOWTDI, I would use the following idiom:
my %ext = ( ... ); ... my $method = $ext{'JPEG'}; print $image->$method; ...

That makes it clearer what the point of the variable is - it's a method name.

------
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.

Replies are listed 'Best First'.
Re: Re: subroutine referencing
by imcsk8 (Pilgrim) on Mar 09, 2004 at 19:29 UTC
    for the sake of clarity, i left the code like that because i sent it to a non-perl programmer and the other way could be kind of obscure for him


    ignorance, the plague is everywhere
    --guttermouth