in reply to Modification of a read-only value attempted

>   my $respons = $response[$i][$j]{creden}{uName};

That's supposed to be the line causing this error?

No way...

Help us to help you by providing more insight.

update

the only possibility I see is auto-vivification of non existent entry "creden" provided $response[$i][$j] is read-only. (if that's even possible)

A prior check would solve this!

update

though the error messages don't match.

DB<72> $a{1}=\1 DB<73> use warnings; say $a{1}{foo}{bar} Not a HASH reference at (eval 81)[c:/Perl_524/lib/perl5db.pl:737] line + 2.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Modification of a read-only value attempted (Readonly + autovivification)
by LanX (Saint) on Feb 01, 2021 at 14:58 UTC
    So I was able to reproduce it
    DB<75> use Readonly; DB<77> Readonly::Hash %has => (key1 => 1, key2 => 2 ); DB<78> x \%has 0 HASH(0x332b388) 'key1' => 1 'key2' => 2 DB<79> $a{1}=\%has DB<80> use warnings; say $a{1}{foo}{bar} Modification of a read-only value attempted at (eval 94)[c:/Perl_524/l +ib/perl5db.pl:737] line 2. DB<81>

    you must check if there is any key {creden} before trying to access a deeper key.

    no autovivification is another possibility.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^2: Modification of a read-only value attempted
by chandantul (Scribe) on Feb 01, 2021 at 15:14 UTC

    This is the JSON response, i suppose to capture below for all 1000 users

    "creden": { "uName": "5xxxxxxx" },