Perl hash printing
You print the hash in a scalar context , combining it with the string '\ n'
If you evaluate the hash in a scalar context, it returns false if the hash is empty. If there are key / value pairs, it returns true; More precisely, the return value is a string consisting of the number of buckets used and the number of buckets allocated, separated by a slash.
2/8means that 8 , 2 is highlighted . Given that you entered only 2, this is good so far :)
, , , , -. print %a; .
@Dark.. .
, "Data:: Dumper"
use Data::Dumper;
...
...
print Dumper(%a);
:
use Data::Dumper;
my %hash = ( key1 => 'value1', key2 => 'value2' );
print Dumper(%hash); # okay, but not great
print "or\n";
print Dumper(\%hash); # much better
:
$VAR1 = 'key2';
$VAR2 = 'value2';
$VAR3 = 'key1';
$VAR4 = 'value1';
or
$VAR1 = {
'key2' => 'value2',
'key1' => 'value1'
};