in reply to Re^4: Can't call method "foo" on unblessed reference
in thread Can't call method "foo" on unblessed reference

I think you've found it. I think you want hole->new(...). I'm not sure what the syntax you've got is going to try to do; indirect syntax for constructors can be problematic.

We're not really tightening our belts, it just feels that way because we're getting fatter.

Replies are listed 'Best First'.
Re^6: Can't call method "foo" on unblessed reference
by Plankton (Vicar) on Jun 16, 2004 at 18:50 UTC
    Thanks Roy!

    I have gotten rid of my "Can't call method ... unblessed ref." error. It appears that I was not making copies of the hole objects correctly. Here's what I was doing ...
    sub makeLinks { ... my @nholes = (); for my $nh ($obj->{'board'}->getHoles()) { my %newHole = %$_; push ( @nholes, \%newHole ); } ... }
    ... and here's what I did to get rid of the error ...
    sub makeLinks { ... my @nholes = (); for my $nh ($obj->{'board'}->getHoles()) { push ( @nholes, new hole ( $nh->{'peg'}, $nh->{'holeIndex'}, $ +nh->{'level'}, $nh->{'links'} )); } ... }

    Plankton: 1% Evil, 99% Hot Gas.