并不真正是一个正则表达式,但是对于用正则表达式难于处理的数据常使用它来进行操纵。因此,tr/[0-9]/9876543210.组成 1223456789,987654321等字符串。 通过使用=~(用英语讲:does,与“进行匹配”同)和!~(英语:doesn't,与“不匹配”同)把这些表达式捆绑到标量上。作为这种类型的例子,下面我们给出六个示例正则表达式及相应的定义: $scalar$scalarName =~ s/a/b;Name =~ s/a/b;Name =~ s/a/b; # substitute the character a for b, and return true if this can happern # substitute the character a for b, and return true if this can happern $scalarName =~ m/a;$scalarName =~ m/a; # does the scalar $scalarName have an a in it? # does the scalar $scalarName have an a in it? ~ tr/A$scalarName =~ tr/A--Z/aZ/a--# translate all capital letter with lower case ones, and returz/; # translate all capital letter with lower case ones, and return ture n ture if this happensif this happens $scalarName !~ s/a/b/;$scalarName !~ s/a/b/; # substitute the character a for b, and return false if this indeed happens.happens. $scalarName !~ m/a/;$scalarName !~ m/a/; # does the scalar $scalarName match the character a? Return false if it does.if it does. $scalarName !~ tr/0$sc...