Kamal Nayan
Kamal Nayan

Reputation: 1940

What is difference between Data::Dump and Data::Dumper modules in Perl?

I have been using Data::Dumper for long times. While searching on google, I found one more similar module Data::Dump.

Can anyone let me know, what are the major differences between the subroutines provided by them?

Upvotes: 7

Views: 1652

Answers (1)

serenesat
serenesat

Reputation: 4709

From Data::Dump doc:

The Data::Dump module grew out of frustration with Sarathy's in-most-cases-excellent Data::Dumper. Basic ideas and some code are shared with Sarathy's module.

The Data::Dump module provides a much simpler interface than Data::Dumper. No OO interface is available and there are fewer configuration options to worry about. The other benefit is that the dump produced does not try to set any variables. It only returns what is needed to produce a copy of the arguments. This means that dump("foo") simply returns '"foo"', and dump(1..3) simply returns '(1, 2, 3)'.

Upvotes: 11

Related Questions