Thus, you can use Data::Dumper to quickly 'dump' the contents of your variables. Yes, you can print a scalar, but printing out complex data structures (like the hash, above) can be tedious. Data::Dumper frees you from the hard work and makes debugging a breeze. If you do CGI work, try dumping the CGI object sometime. It's most informative :)

Once you get used to using Data::Dumper, reread the documentation. It will be easier to understand.

In some ways I see Data::Dumper as a debugging tool, yet it has many uses beyond.

I most frequently use the exported Dumper function. You feed it a data structure (array,hash,etc) or a complex data structure (hashes and arrays multiple
levels deep in any combination, objects etc.) and it will return the complete contents to you. This makes object debugging much easier for me because often times the issue is in
the fact that an attribute of object didn't get set correctly. With Dumper you can do this:

That will print what you already know since you created the structure, but what if you are getting back something that you are not sure of the contents on? This is where it comes in handy for both debugging and sometimes better understanding the contents in an object.
Like so ( i am using code from an earlier post by artist ):

That will show you the complete data structure of a newly created object.

I feel
that the docs for Data::Dumper don't really make it clear
how you would apply this module for someone that
isn't doing full time development. Once you see how it is
applied it will most likely become a very valuable debug
utility for anyone working with hidden (dynamic) data
structures, which should be most everyone I hope.

Another use of Data::Dumper is persistent storage.
If you want to reuse your variable a few days later
in another program,
you apply Data::Dumper to the variable, and you print
the result into a file, or you store it into a database.

Then, in the next program, a few days later, you just
do the file (or you eval the result
of the database query), and your second program can
use the value computed by the first program.

There are other modules to get persistency: Storable,
Freezethaw, but their output is not human-readable.

A problem I had with using Data::Dumper for persistance was that it took so much RAM when used with a big datastructure because it created the whole outputstring in RAM. (Storable is a little bit better). In the moment I'm just working at a program that takes about 500-800MB RAM (under Win2k or Solaris 32 bit) with one main datastructure (LDAP-LDIF-like datastructure). If I want to print such a Datastructure with Data::Dumper to a file, there always comes an Out-of-memory-Error.