On Tue, 6 Sep 2016 17:01:52 -0400
Uri Guttman <u...@stemsystems.com> wrote:

> 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.

True but /e does. ;)


-- 
Don't stop where the ink does.

        Shawn H Corey
        mailto:shawnhco...@nili.ca

-- 
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