in reply to Re: Calling OO-method From A Hash
in thread Calling OO-method From A Hash

I'd like to make a small note, namely despite being a symbolic reference (in my book),
$quiz->$act()
passes strict without any form of complaint.
use strict; sub Foo::hello { shift; printf "Hello, %s!\n", shift; } my $meth = "hello"; my $class = "Foo"; $class->$meth("world");

Replies are listed 'Best First'.
Re: Re: Re: Calling OO-method From A Hash
by dragonchild (Archbishop) on Mar 03, 2004 at 13:30 UTC
    Method lookup is done at runtime. So, what's wrong with allowing an extra dereference?

    It does bring up the point that $class->$meth() is not the same as $meth($class). (It is, however, the same as $class->can($meth)->($class). *grins*)

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