quivalent function like print_r() [duplicate]
Possible Duplicate:
What is Perl's equivalent to PHP's print_r()?
is there equivalent function like print_r() in perl ,
There is the Data::Dumper module (which is core module):
use Data::Dumper;
my $var = {'a' => 'Apfel', 'b' => 'Banane', 'c' => ['x', 'y', 'z']};
print Dumper($var);
Gives for the above example:
$VAR1 = {
'c' => [
'x',
'y',
'z'
],
'a' => 'Apfel',
'b' => 'Banane'
};
which can be eval'ed back into Perl.
精彩评论