in reply to Re^4: Modification of a read-only value attempted
in thread Modification of a read-only value attempted

Re^2: Modification of a read-only value attempted (Readonly + autovivification) last phrase :)

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

  • Comment on Re^5: Modification of a read-only value attempted

Replies are listed 'Best First'.
Re^6: Modification of a read-only value attempted
by chandantul (Scribe) on Feb 01, 2021 at 21:31 UTC

    There are entries that $response$i$j{creden} don't have following {uName}; hence i am getting the error. I would like to check if $response$i$j{creden} key having the value {uName}; or not to verify a check before assign the value to a new variable. Any help is appriciated.

      exists is your friend.

      you need to test for existence of both {creden} and {creden}{uName} in an if condition

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

        The "creden" value is null like the following "creden": null, and other one is the following "creden": { "uName": "5xxxxxxx" }, set the below condition for them and it works!

        if ($response[$i][$j]{creden} ne "" ) { $responsuname = $responsetextall[$i][$j]{creden}{uName +}; } else { $responsuname = "No UNAME"; }