in reply to Re: Re: Passing a reference to a subroutine in a constructor
in thread Passing a reference to a subroutine in a constructor

$self->{sorter}->($keys);

Note the squigglies when de-referencing $self and the round parens when de-referencing the sort routine coderef.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

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: Re3: Passing a reference to a subroutine in a constructor
by DrSax (Sexton) on Aug 22, 2003 at 20:24 UTC
    Rob,

    It's always a pleasure to see a guy whose sig line is longer than his response... ;-)

    Brian (a.k.a. DrSax)