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

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