in reply to subroutines and references in Everything

Nodegroup nodes only contain node_ids in the group field. You need actual nodes. The simplest way to do this is to add a getRef() call in the loop within showphotoGroup():
foreach my $ptolist (@GROUP) { $ptolist = getRef($ptolist); $str .= "<li>".$$ptolist{title}."</li>"; }
It won't hurt any nodes you pass in. (You're right about htmlcode nodes being subroutines, in more ways than one.)