On Tue, 6 Sep 2016 17:01:52 -0400
Uri Guttman <[email protected]> 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:[email protected]
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/