Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

How do I print out or copy a recursive data structure?

by faq_monk (Initiate)
on Oct 08, 1999 at 00:20 UTC ( #640=perlfaq nodetype: print w/ replies, xml ) Need Help??

Current Perl documentation can be found at

Here is our local, out-dated (pre-5.6) version:

The Data::Dumper module on CPAN is nice for printing out data structures, and FreezeThaw for copying them. For example:

    use FreezeThaw qw(freeze thaw);
    $new = thaw freeze $old;

Where $old can be (a reference to) any kind of data structure you'd like. It will be deeply copied.

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2015-11-25 07:57 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls