#!/usr/bin/env perl use strict; use warnings; use JSON; use Scalar::Util qw/ readonly /; my $data = decode_json('{ "val":false }'); print "readonly: ", readonly($data->{val}) ? 'yes' : 'no', "\n"; bless $data->{val}; #### $./try readonly: no Modification of a read-only value attempted at ./try line 10.