in reply to Syntax for passing objects to subroutine

It's probably not doing what you think. If the object were a Boost::Graph, it would not print main=HASH(0x9165900), unless it got reblessed into main, but Boost::Graph=HASH(0x800d80). You also seem to be creating things outside the scope in which you're using them. Make sure to run with strict and warnings.

(Update: my eyes are going: Perlbotics correctly notes below that it is getting reblessed into main.)