in reply to creating objects via string representations?

If you have the output of Data::Dumper, you can simply eval it to create the object!

If you have complicated inter-references between the objects, you need to be sure to give the correct options to Data::Dumper (e.g. set $Data::Dumper::Purity = 1) to get the references correct. If you use the 2-argument form for Dumper, it will use the variable names you specify for the objects.

People (e.g. merlyn) that in certain edge cases Dumper might break references to the same object, inadvertently duplicating it, but in most cases it works fine (and that article is old enough that perhaps this issue has been fixed by now...).


--JAS

Replies are listed 'Best First'.
Re^2: creating objects via string representations?
by Anonymous Monk on Nov 27, 2008 at 20:58 UTC
    Any thoughts on the syntax?