- 论坛徽章:
- 0
|
1 #!/usr/bin/perl -w
2 use strict;
3 my $file = shift;
4 my $rp;
5 my $new;
6 my $out;
7 my $final;
8 open IN, $file or die $!;
9 while (<IN>){
10 if( $_ =~ /N|A/){ print $_;}
11 if($_ =~/abc/){
12 $rp=$_;
13 print "\$rp is $rp\n";
14 $new ="change";
15 print "\$new is $new\n";
16 $out = "abcdefg";
17 # no strict subs;
18 $out=~s/\Q${rp}\E/\Q${new}\E/;
19
20
21 print "\$out is $out \n";
22 }
23 }
24 my $aaa= "abcdefg";
25 my $rrp= "abc";
26 my $neww= "xxx";
27 $aaa=~s/\Q${rrp}\E/\Q${neww}\E/g;
28 print "\$aaa is $aaa \n";
29 my $pattern="a.*.b";
30 my $str ="ca.*.bc";
31 if($str=~s/\Q${pattern}\E/sds/) {
32 print "ok\n\$str is $str\n";
33 }
##18 $out=~s/\Q${rp}\E/\Q${new}\E/; -----》 这句他没有执行。。。。肿么了。。。。????各位看看吧,谢谢!! |
|