Help for this page

Select Code to Download


  1. or download this
    while(<INFILE>){    
        $_ =~ s/$searchPattern1/$repalcePattern1/g;
    ...
        $_ =~ s/$searchPattern3/$replacePattern3/g;
        print OUTFILE $_;
    } # end while
    
  2. or download this
    if ($_ == s/$searchPattern1/){
     print("$searchPattern1 replaced with $replacePattern1 \n");
    ...
    }else{
     print("Search Patterns not found");
    }
    
  3. or download this
    while(<INFILE>){
     if ($_ == s/$searchPattern1/){
    ...
     }
     print OUTFILE $_;
    } # end while
    
  4. or download this
    <SOURCEFILE>
    foo bar         <\n>
    ...
    foo bar<\n>
    foobar<\n>
    BlahBlah Blah<\n>