#! perl use strict; use warnings; use Data::Dump; use YAML::XS; my $hash = { Fred => 'Wilma', Frederick => 'Mary', Barney => 'Fred' }; my $yaml = Dump $hash; $yaml =~ s/\bFred\b/FRED/; $hash = Load $yaml; dd $hash; #### 0:26 >perl 1186_SoPW.pl { Barney => "FRED", Fred => "Wilma", Frederick => "Mary" } 0:30 > #### $yaml =~ s/(?<=\n)Fred(?=:)/FRED/g;