my $tableau; for my $p(0..6) { $tableau->[$p] = Pile->new({ max => 52 }); for (1..$p) { my $card = $deck->GetRandCard(); $card->state('down'); $tableau->[$p]->fill_pile($card); } my $card = $deck->GetRandCard(); $card->state('up'); $tableau->[$p]->fill_pile($card); } ... my $tab_imgs; my $i = 1; for(@$tableau) { ## Here's the line that's causing the problems -> my $c = ($_->cards())[0]->label(); my $photo = $canvas->Photo(-file => "$card_dir\\$c.$ext", -format => 'gif'); push @$tab_imgs, $canvas->createImage(50+$i++*50,500, -image => $photo); } # Stuff in pile.pm (tableau calls # new,fill_pile,get_rand_card) sub new { my $proto = shift; my $self = shift; my $class = ref($proto) || $proto; $self->{next} = 0; bless ($self, $class); return $self; } sub fill_pile { my $self = shift; my $cards = shift; $self->{cards} = [$cards,$self->{cards}]; } sub GetRandCard { my $pile = shift; my $card = ($pile->shuffle())->[0]; $pile->remove_card; return $card; } # oh, and before I forget, the data::dumper print up # this is of ($_->cards())[0], the thing that tries to call # label, but can't cause it's "not blessed" $VAR1 = [ bless( { 'state' => 'up', 'where' => bless( { 'next' => 0, 'max' => 52, 'cards' => [ bless( { 'state' => 'down', 'where' => $VAR1->[0]{'where'}, 'value' => '1', 'suit' => 'h' }, 'Card' ), ##.. more stuff like this ] }, 'Pile' ), 'value' => 'q', 'suit' => 's' }, 'Card' ), undef ];