私はPerlの専門家ではないので、これはおそらく簡単な質問です。
私はStorableを使用しており、この例に従ってハッシュを保存しています。まず、元のハッシュを保存します。
use Storable qw(store retrieve freeze thaw dclone);
%color = ('Blue' => 1, 'Red' => 0.8, 'Black' => 0, 'White' => 1);
store(\%color, 'mycolors');
それから私はそれを取得します。(別のスクリプト)
use Storable qw(store retrieve freeze thaw dclone);
$colref = retrieve('mycolors');
printf "Blue is still %lf\n", $colref->{'Blue'};
私の質問は、ハッシュ値の1つを変更するにはどうすればよいですか?たとえば、次のようなことをします
$colref->{'Blue'} = 2;
store(\%color, 'mycolors');
2番目のスクリプトで。