Home >> perlexamples >>
Perl Data::Dumper#!/usr/bin/perl
use Data::Dumper qw(Dumper);
my %hash = ( a => 1, b => 2, c => 3 );
print Dumper(\\%hash); # note the \ backslash; Dumper() takes referenc
+es as arguments
$./example
Output:
$VAR1 = {
'c' => 3,
'a' => 1,
'b' => 2
};
lets do one more modification #!/usr/bin/perl
use Data::Dumper qw(Dumper);
my %hash = ( a => 1, b => 2, c => 3 );
print Dumper(\\%hash); # note the \ backslash; Dumper() takes referenc
+es as arguments
$./example
Output:
$VAR1 = {
'c' => [
0,
1,
2,
3
],
'a' => 1,
'b' => 2
};
Perl functions
|
handling Errors in perl How to include module in perl? number of matches in regex perl: How to parse config file
Download perl
download stable version of perl
Perl 5.10.1
|
|