Gossamer Forum
Home : General : Perl Programming :

Search and Replace

Quote Reply
Search and Replace
How to search and replace all word that match in a file with the hash below? Thanks!

%word = ('old'=>'new', '97'=>'98');

Quote Reply
Re: Search and Replace In reply to
Not quite sure I understand? Do you want to search a file and replace all instances of old with new and 97 with 98?

Cheers,

Alex
Quote Reply
Re: Search and Replace In reply to
Yes, but not only replace old with new and 97 with 98, is to replace it with all of the text in a hash.