my %hash = (...); my $src = do { local $/; <> }; my $res = join '', map $hash{$_} // $_, split /\b/, $src; # %hash = (a => 'xxx') # $src = 'a b ab'; # $res = 'xxx b ab';
In reply to Re: how to substiute given key with value by using hash.
by happy.barney
in thread how to substiute given key with value by using hash.
by harshmane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |