in reply to Object-Oriented Persistence and Message Passing with Cons

Humm... I fail to understand what the advantage of this method over just Data::Dumper

Plus how does it deal with code references, or nested references (as in a tree)? Those are usually the hard parts.

Would you care to elaborate?

  • Comment on RE: Object-Oriented Persistence and Message Passing with Cons

Replies are listed 'Best First'.
RE: RE: Object-Oriented Persistence and Message Passing with Cons
by princepawn (Parson) on Oct 13, 2000 at 19:07 UTC
    This method is more definitional than the use of Data::Dumper. You focus on importing and exporting and use as opposed to dumping and evaling.

    Excellent question, it DOES handle both nested references and code refs. Updated and more complex example follows:

    Construct File

    po = { 1, 'two', 'buckle my', [ 'Florsheim', 'Nike', 'Sandals', 'Thongs' ], 'shoo' }; $sub = sub { print "code ref passed to the edge of panic boyeeeee\n" } +; Export qw (po sub); Build qw (tmp/Conscript);

    Conscript file

    Import qw( po sub ) ; use Data::Dumper; warn Data::Dumper->Dump([$po],['po']); $sub->();

    OUTPUT

    $po = { 'shoo' => undef, 1 => 'two', 'buckle my' => [ 'Florsheim', 'Nike', 'Sandals', 'Thongs' ] }; code ref passed to the edge of panic boyeeeee