... what does this line:
(my $mask = $s1) =~ tr{-\x00-,.-\xff}{\x00\xff};
It copies the string $s1 to the new lexical $mask while simultaneously translating the characters of $s1 with the tr/// function. If you have Perl version 5.14+, you can simplify this statement somewhat by using the /r modifier:
my $mask = $s1 =~ tr{-\x00-,.-\xff}{\x00\xff}r;
See tr/// in the Quote-Like Operators section in perlop.
... which is the null character?
It is the \0 character (or byte), hex 0x00, octal 000 (also decimal 0). (Update: Along with its cousin 0xff, it's very useful for creating bit-masks for strings.)
In reply to Re^3: How to make this substitutions without splitting the strings?
by AnomalousMonk
in thread How to make this substitutions without splitting the strings?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |