正则里能有变量吗。。新手
- open SQLTEST, ">c:\DINO.txt";
- while (<>) {
- chomp;
- ##print "it was $_ that i saw!\n";
- $_=~s/ union\s*all /\n##################\nunion all\n####################3\n /x;
- my $a=$_;
- print SQLTEST "$a\n";
- }
请指教
open SQLTEST, ">c:\DINO.txt";
chomp($line=<STDIN>);
while (<>) {
chomp;
##print "it was $_ that i saw!\n";
$_=~s/ union\s*all /\n##################\nunion all\n####################3\n /x; 这段是否可以修改呢?my $a=$_;
print SQLTEST "$a\n";
}
变量能放到正则里吗。。。
作者: 落羽飘寻 发布时间: 2011-05-26
可以
作者: jin2251138 发布时间: 2011-05-26