Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 352
Kamal Nayan Avatar asked Nov 23 '15 07:11

Kamal Nayan


1 Answers

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)'.

like image 90
serenesat Avatar answered Nov 20 '22 00:11

serenesat