in reply to oo code ref

use strict; use warnings; use 5.010; package Foo; sub x {say "Hello"} package main; foo(); sub foo { my $obj = bless [], 'Foo'; my $sub = $obj->can('x'); goto &$sub } __END__ Hello

Replies are listed 'Best First'.
Re^2: oo code ref
by plobsing (Friar) on Nov 10, 2008 at 12:36 UTC

    You'll probably want to unshift @_, $obj before goto &$sub to get the invocant into the argument list.