- or download this
package Foo;
sub new
...
{
print "This is the correlation function!";
}
- or download this
my $x = new Foo(method => 'biscuit');
- or download this
if exists $self->{funcs}{$self->{method}}
{
...
{
die "Sorry, the method $self->{method} isn't valid!";
}
- or download this
#This says "Not a CODE referece at Foo.pm line..."
$self->{funcs}{correlation} = \&$self->correlation;
...
#And this says "Scalar found where operator expected at
# Foo.pm line...
$self->{funcs}{correlation} = \&($self->correlation);