my $yaml_hash_ref = YAML::XS::LoadFile($test.yaml); $yaml_hash{editable}->{storage}->{iser}->{value} = $use_iser_protocol; # whatever i put here i get error cannot modify readonly. YAML::XS::DumpFile("$tmp_file",$yaml_hash_ref);