http://qs321.pair.com?node_id=624681

jfrm has asked for the wisdom of the Perl Monks concerning the following question:

I hope not to trouble your meditations for more than a second as I'm sure the answer to this must be obvious to all but me. I just want to sort an array of objects.

print "££".$unsorted[0]->function."<br>"; @sorted = sort {$unsorted[$a]->function <=> $unsorted[$b]->function} @ +unsorted;

I've added a print statement which works and produces correct output so I assume I have the syntax correct for the object. So why does my sort get the error messages

Use of reference "GARD::Book=HASH(0x2b7831c)" as array index at db.pl +line 439. Can't call method "function" on unblessed reference at db.pl line 439.

please help a pitiful soul...