http://www.perlmonks.org?node_id=754662


in reply to Data::Dumper question

RTFM?
$OBJ->Values([ARRAYREF])

Queries or replaces the internal array of values that will be dumped. When called without arguments, returns the values. Otherwise, returns the object itself.

Update (example code):

print $d->Values([$this])->Dump(); print $d->Values([$that])->Dump(); print $d->Values([$otherthing])->Dump();

-- Frank

Replies are listed 'Best First'.
Re^2: Data::Dumper question
by perl5ever (Pilgrim) on Apr 01, 2009 at 13:41 UTC
    I guess I did overlook that. Thanks! For convenience it would be nice, though, if that capability was integrated into the Dump method.
Re^2: Data::Dumper question
by perl5ever (Pilgrim) on Apr 01, 2009 at 13:39 UTC
    I guess I did overlook that. Thanks!
Re^2: Data::Dumper question
by perl5ever (Pilgrim) on Apr 01, 2009 at 17:33 UTC
    Here's another problem -- when you set the thing to be dumped via Values(), the Dumper object retains a reference to the thing to be dumped.

    It would be a lot nicer if it would just hold on to the dumpee only for the duration of the Dump call.