in reply to references to subroutines

Nevermind I figured it out:

my %menu = ( n => \&Subs::new; );


That was dumb.

Replies are listed 'Best First'.
•Re: Re: references to subroutines
by merlyn (Sage) on Mar 14, 2002 at 01:38 UTC
    Except if that's a method call, that won't work, because you're not passing the name of the class as the first parameter. Try this:
    my %menu = ( n => sub { Subs->new }, );

    -- Randal L. Schwartz, Perl hacker