On 09/06/2016 04:42 PM, X Dungeness wrote:
It's kinda hard to see but I included the /x switch because
I inserted blanks on the pattern as well as the replacement
side. Without /x, the match will fail.

$str =~ s{  ([^[:print:]])  }{ sprintf( "(%#2X)", ord $1) }gex;
                  ^                  ^
you are correct. /x affects whitespace in the pattern. i was stuck thinking about the replacement part. in fact now that i am thinking about it more clearly, /x doesn't affect the replacement at all.

thanx,

uri



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to