http://qs321.pair.com?node_id=786199


in reply to Re^4: About a piece of code
in thread About a piece of code

\s is not a single character in a regular expression, it is the character class [ \t\n\r\f].   See perlre.

$ perl -le' use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper grep /\s/, map chr, 0 .. 255; ' $VAR1 = "\t"; $VAR2 = "\n"; $VAR3 = "\f"; $VAR4 = "\r"; $VAR5 = " ";

In a double quoted string it is just the character "s".

$ perl -le' use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper "\s"; ' $VAR1 = "s";