replace words in string with hash values

From: wana (ioneabu_at_yahoo.com)
Date: 11/29/04

  • Next message: dale zhang: "Re: how to define a variable to hold a multiline text input in perl from html multiline textbox"
    Date: 29 Nov 2004 12:23:16 -0800
    
    

    foreach (keys %h)
    {
      $a =~ s/\b$_\b/$h{$_}/g;
    }

    I want to replace matches in string to hash key with hash value. I am
    replacing acronyms with phrases where acronym is hash key. Is there a
    better or different way?

    thanks!

    wana (on pda)


  • Next message: dale zhang: "Re: how to define a variable to hold a multiline text input in perl from html multiline textbox"

    Relevant Pages

    • Re: replace words in string with hash values
      ... >> I want to replace matches in string to hash key with hash value. ... >> replacing acronyms with phrases where acronym is hash key. ... > You have Perl search the whole string as many times as there are keys in ...
      (comp.lang.perl.misc)
    • Re: replace words in string with hash values
      ... > I want to replace matches in string to hash key with hash value. ... > replacing acronyms with phrases where acronym is hash key. ... You have Perl search the whole string as many times as there are keys in ...
      (comp.lang.perl.misc)
    • Re: replace words in string with hash values
      ... >I want to replace matches in string to hash key with hash value. ... >replacing acronyms with phrases where acronym is hash key. ...
      (comp.lang.perl.misc)
    • Re: replace words in string with hash values
      ... > I want to replace matches in string to hash key with hash value. ... > replacing acronyms with phrases where acronym is hash key. ...
      (comp.lang.perl.misc)
    • Re: Hashing a password
      ... This is the password hashing ... I take it that the hash key is some 8 bit binary code? ... string value in PHP may be larger than 8 bits, ... That would make the XOR ...
      (comp.lang.php)