Data Dumper in Perl

Home > Search
  by

The Data Dumper module let's you visual how data is being interpretted by Perl. You may need to install the Data Dumper module on your system. Then, you will tell your Perl script to use the Data Dumper module.

use Data::Dumper;

 

As a very simple example, let's say your script has a variable ($foo) and you want to understand what value $foo contains. You can use Data Dumper to examine $foo.

print Dumper $foo;

 

In this example, Data Dumper let's you know that $foo contains a value of Hello World.

$VAR1 = 'Hello World';

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments