http://www.perlmonks.org?node_id=934506

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

Is it possible to change what '\s' means? It's not matching the non-breaking-space (chr(160)) that I found in this file I have to parse and I'd like it to.

I know, I could just edit my regex to say [chr(160)\s] or something like that, but that's not as fun. And it wouldn't change the behavior of any regexen I didn't manually edit, like ones in someone else's module, for instance.

Said another way, I'd like

my $string = ' '.chr(160).' '; if ( $string =~ /^\s*$/ ) { print "Happy Happy!"; }

... to print "Happy Happy!"

Thanks!

--Pileofrogs