in reply to Re: variables names used to define variables
in thread variables names used to define variables

There are no references to subs involved in finding methods when it comes to class or object method calling.

Yes there is. Otherwise, this code wouldn't work:

$ perl -Mstrict -e ' package My::Foo; sub bar { my $class = shift; print "Calling $class->bar\n"; } package main; my $class = "My::Foo"; my $method = "bar"; $class->$method(); ' Calling My::Foo->bar $

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: variables names used to define variables
by Abigail-II (Bishop) on Dec 11, 2003 at 17:06 UTC
    That's no more a reference than
    my %hash; my $key = "foo"; $hash {$key} = 1;
    is.

    Abigail

      Although this might be splitting hairs, the Blue Camel disagrees (p. 313):

      Although you're using the name of the method to invoke it indirectly, this usage is not forbidden by use strict 'refs', since all method calls are in fact looked up symbolically at the time they're resolved.

      Unless the author of that passage (Tom Christiansen, I think) also considers hash lookups to be symbolic.

      ----
      I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
      -- Schemer

      : () { :|:& };:

      Note: All code is untested, unless otherwise stated