Reilly has asked for the wisdom of the Perl Monks concerning the following question:

How to I express HEX values in substitution strings. I want to find a FF 30 39 which is also an 09. The 09 is a tab jump which is not in play here. My file to be converted has FF 30 39 when I do a HEX dump. I need to convert hyphens (-) to FF 30 39. Can someone help?

2006-03-14 Retitled by planetscape, as per Monastery guidelines
Original title: 'hex characters'

Replies are listed 'Best First'.
Re: Search and Replace Hexadecimal String
by ikegami (Patriarch) on Mar 13, 2006 at 19:40 UTC
    Like in any other interpolating string: \xFF\x30\x39 or \x{FF}\x{30}\x{39}
      I don't know an interpolating string from a violin string. I am not a program. I am writing a large file of substitution strings to convert data structures for a typesetting program. I really appreciate your answer because these conversion tables are the only thing close to programming I have ever done. They are working great except for about three HEX values that were showing up and got me in a corner
Re: Search and Replace Hexadecimal String
by chargrill (Parson) on Mar 14, 2006 at 04:18 UTC
    Reilly: Didn't someone else answer your question here: hex characters?


    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
      Yes, thanks. I got what I needed.