hashref Questions
1
perl -E 'say for map s/(æ|ø|å)/ {qw(æ ae ø oe å aa)}->{$1}/ger, qw(rød gul blå)'
perl -E 'say for map s/(æ|ø|å)/"".{qw(æ ae ø oe å aa)}->{$1}/ger, qw(rød gul blå)'
The first line above give...
5
I have a compound hashref as follows
my $ch = {
k1 => [ { k=>1 }, { m=>2 } ],
k2 => [ { l=>90}, ... ],
};
Hash::Util::lock_hashref_recurse($ch) does not effectively lock these v...
4
Solved
I have a Perl class/module that I created to display Bible verses. In it there is a hash that stores several verses, with the key being the book/chapter/verse and the value being the text. This has...
Beanstalk asked 25/6, 2013 at 13:4
2
if((scalar keys ($this->{'libraries'}->{$y}->{'cellHash'})) == 0){
This is the line where I am getting the "Type of argument to keys on reference must be unblessed hashref or arrayref" ...
2
Solved
$a = {b=>{c=>1}}; # set up ref
$b = $a->{b}; # ref the ref
$b .= (d=>1,e=>1); # where we want to assign multiple key/val at once
At the end of it $a should look like:
{
'b' =>...
1
© 2022 - 2024 — McMap. All rights reserved.