Does $Data::Dumper::Maxdepth fix things for you? If not (i.e. if you want to truncate a depth-first printout), then you may have to roll your own. You also *might* be able to wrap Data::Dumper::_dump() to keep track of how much it has produced, then use goto LABEL or die() to jump out when you have enough output. But Data::Dumper is partially XS, so that could be dangerous.